-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest2.py
More file actions
27 lines (22 loc) · 761 Bytes
/
Test2.py
File metadata and controls
27 lines (22 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
from Problem_2 import print_depth, Person
class Test2(unittest.TestCase):
def test_print_depth(self):
person_a = Person("first_name:","last_name:","father:")
person_b = Person("first_name:","last_name:",person_a)
data = {
"key1": 1,
"key2": {
"key3": 1,
"key4": {
"key5": 4,
"user": person_b
}
}
}
result = ['key1 1','key2 1','key3 2','key4 2','key5 3',
'user 3', 'first_name 4', 'last_name 4', 'father 4', 'first_name 5',
'last_name 5', 'father 5']
self.assertNotEqual(print_depth(data), result)
if __name__ == '__main__':
unittest.main()