Skip to content

Commit 99a92b4

Browse files
commit code
1 parent 6bfc1e7 commit 99a92b4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

account.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ def sub(x, y):
77

88

99
class Account:
10-
pass
10+
def __init__(self, name):
11+
self.name = name
12+
13+

accout_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_that_can_sub(self):
2222

2323
class Account_Test(unittest.TestCase):
2424
def test_that_account_can_be_created(self):
25-
account1 = account.Account()
25+
account1 = account.Account("tobi")
2626

2727
self.assertIsNotNone(account1)
2828
self.assertIsInstance(account1, account.Account)
@@ -33,7 +33,9 @@ def test_that_account_has_a_name(self):
3333
WHEN:
3434
THEN:
3535
"""
36-
36+
account1 = account.Account("tobi")
37+
name = account1.name
38+
self.assertEqual("tobi", name)
3739

3840

3941
if __name__ == '__main__':

0 commit comments

Comments
 (0)