chore: initialize containerized Python learning workbook (2026 DevOps/SRE)
This commit is contained in:
commit
ae4c421815
63 files changed
+1273
No files matched your search
@@ -0,0 +1,16 @@
|
||||
from oop_ex import AlertService, BankAccount, EmailNotifier, SmsNotifier
|
||||
|
||||
|
||||
def test_bank_account() -> None:
|
||||
acc = BankAccount(100)
|
||||
acc.deposit(50)
|
||||
assert acc.balance == 150
|
||||
assert acc.withdraw(40) is True
|
||||
assert acc.balance == 110
|
||||
assert acc.withdraw(500) is False
|
||||
assert acc.balance == 110
|
||||
|
||||
|
||||
def test_alert_service_protocol_composition() -> None:
|
||||
svc = AlertService([EmailNotifier("ops@example.com"), SmsNotifier("+48123456789")])
|
||||
assert svc.broadcast("CPU 95%") == ["[email] CPU 95%", "[sms] CPU 95%"]
|
||||
Reference in new issue
Block a user