init commit; source - Intermediate Python - recorded for Frontend Masters; Created by Nina Zakharenko; https://www.learnpython.dev
This commit is contained in:
commit
d7a3dff32e
4 files changed
+2486
No files matched your search
@@ -0,0 +1,20 @@
|
||||
from bankclass import SavingsAccount
|
||||
import unittest
|
||||
|
||||
class TestBankClass(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.acc = SavingsAccount("Alice", 1000, 0.05)
|
||||
|
||||
def test_apply_interest(self):
|
||||
self.assertEqual(self.acc.apply_interest(), 1050)
|
||||
|
||||
def test_savings_withdraw(self):
|
||||
self.acc.withdraw(400)
|
||||
self.assertEqual(self.acc.balance, 600)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
# ---
|
||||
# now do with higher level pytests instead
|
||||
Reference in new issue
Block a user