forked from chepe4pi/test_task
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (32 loc) · 714 Bytes
/
test.py
File metadata and controls
40 lines (32 loc) · 714 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
28
29
30
31
32
33
34
35
36
37
38
39
40
from ma import *
from mb import B
def test():
a = A()
b = B(5)
assert(a.i == 3)
assert(a.fnc(2) == 2 * 2 * 3)
assert(b.fnc(10, 4) == 10 * 4 * 5)
assert(a.isFirst() == 1)
assert(a.isSecond == 0)
assert(b.isFirst() == 0)
assert(b.isSecond == 1)
assert(isinstance(a, First))
assert(isinstance(b, Second))
assert(isinstance(a, Parent))
assert(isinstance(b, Parent))
try:
a.fnc(7)
except MyError as v:
if str(v) != "Error text":
assert(0)
else:
assert(0)
try:
a.isSecond = 2
except AttributeError:
pass
else:
assert(0)
if __name__ == "__main__":
test()
print("done")