summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/typemap_documentation_runme.py
blob: 3d1c6fa8c243b9255327a5fd3741ee703e19c6c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import typemap_documentation

f = typemap_documentation.Foo()
f.x = 55
b = typemap_documentation.Bar()
b.y = 44

if 55 != typemap_documentation.GrabVal(f):
    raise RuntimeError("bad value")

try:
    typemap_documentation.GrabVal(b)
    raise RuntimeError("unexpected exception")
except TypeError:
    pass

if 55 != typemap_documentation.GrabValFooBar(f):
    raise RuntimeError("bad f value")
if 44 != typemap_documentation.GrabValFooBar(b):
    raise RuntimeError("bad b value")