Skip to content

Commit 6bfc1e7

Browse files
commit code
1 parent b3d2784 commit 6bfc1e7

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

account.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def add(x, y):
2+
return x + y
3+
4+
5+
def sub(x, y):
6+
return x - y
7+
8+
9+
class Account:
10+
pass

accout_test.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import unittest
2+
import account
3+
4+
5+
# from . import account
6+
7+
8+
class AccountTest(unittest.TestCase):
9+
def test_that_account_can_be_created(self):
10+
result = account.add(2, 3)
11+
self.assertEqual(5, result)
12+
13+
def test_sub(self):
14+
self.assertEqual(5, account.sub(7, 2))
15+
16+
17+
class Account_sub(unittest.TestCase):
18+
def test_that_can_sub(self):
19+
sub = account.sub(10, 5)
20+
self.assertEqual(5, sub)
21+
22+
23+
class Account_Test(unittest.TestCase):
24+
def test_that_account_can_be_created(self):
25+
account1 = account.Account()
26+
27+
self.assertIsNotNone(account1)
28+
self.assertIsInstance(account1, account.Account)
29+
30+
def test_that_account_has_a_name(self):
31+
"""
32+
GIVEN:
33+
WHEN:
34+
THEN:
35+
"""
36+
37+
38+
39+
if __name__ == '__main__':
40+
unittest.main()

file.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)