MCPcopy Index your code
hub / github.com/exaloop/codon / test_codon_extensions

Function test_codon_extensions

test/python/pyext.py:15–410  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

13saw_foo = False
14
15def test_codon_extensions(m):
16 m.reset()
17
18 # functions #
19 #############
20
21 global saw_fun
22
23 if hasattr(m, 'f1'):
24 assert m.f1(2.2, 3.3) == (2.2, 3.3)
25 assert m.f1(2.2, 3.3) == (2.2, 3.3)
26 assert m.f1(3.3) == (3.3, 2.22)
27 assert m.f1() == (1.11, 2.22)
28 assert m.f1(a=2.2, b=3.3) == (2.2, 3.3)
29 assert m.f1(2.2, b=3.3) == (2.2, 3.3)
30 assert m.f1(b=3.3, a=2.2) == (2.2, 3.3)
31 assert m.f1(a=2.2) == (2.2, 2.22)
32 assert m.f1(b=3.3) == (1.11, 3.3)
33
34 try:
35 m.f1(1.1, 2.2, 3.3)
36 except:
37 pass
38 else:
39 assert False
40
41 try:
42 m.f1(z=1)
43 except:
44 pass
45 else:
46 assert False
47
48 assert m.f2() == ({1: 'one'}, {2}, [3])
49
50 try:
51 m.f2(1)
52 except:
53 pass
54 else:
55 assert False
56
57 try:
58 m.f2(z=1, y=5)
59 except:
60 pass
61 else:
62 assert False
63
64 assert m.f3(42) == 84
65 assert m.f3(1.5) == 3.0
66 assert m.f3('x') == 'xx'
67
68 try:
69 m.f3(1, 2)
70 except:
71 pass
72 else:

Callers 1

pyext.pyFile · 0.85

Calls 4

equalFunction · 0.85
dupFunction · 0.85
par_sum_checkFunction · 0.85
resetMethod · 0.80

Tested by

no test coverage detected