forked from RobinD42/pybindgen-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_autogentest.py
54 lines (37 loc) · 1.11 KB
/
test_autogentest.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import unittest
import autogentest as agt
class TestCases(unittest.TestCase):
@unittest.expectedFailure
def test_ABCctor(self):
a = agt.A()
def test_overloads(self):
b = agt.B()
b.overloadedMethod()
b.overloadedMethod(1, 2)
b.overloadedMethod(1.23)
b.overloadedMethod(1)
@unittest.expectedFailure
def test_tooManyArgs(self):
b = agt.B()
b.overloadedMethod(1, 2, 3)
def test_defaultArgs(self):
b = agt.B()
b.defaultArgs()
b.defaultArgs(1)
b.defaultArgs(1, 2)
def test_keywordArgs(self):
b = agt.B()
b.defaultArgs()
b.defaultArgs(a=5, b=6)
b.defaultArgs(b=5, a=6)
b.defaultArgs(b=6)
def test_isinstance(self):
b = agt.B()
c = agt.C()
assert isinstance(b, agt.B)
assert isinstance(b, agt.A)
assert isinstance(c, agt.C)
assert isinstance(c, agt.B)
assert isinstance(c, agt.A)
if __name__ == '__main__':
unittest.main()