swig/Examples/test-suite/python/kwargs_runme.py
William S Fulton fa423253a9 beefed up the kwargs tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6453 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-20 21:05:34 +00:00

44 lines
616 B
Python

from kwargs import *
# Simple class
f = Foo(b=2,a=1)
if f.foo(b=1,a=2) != 3:
raise RuntimeError
if Foo.statfoo(b=2) != 3:
raise RuntimeError
if f.efoo(b=2) != 3:
raise RuntimeError
if Foo.sfoo(b=2) != 3:
raise RuntimeError
# Templated class
b = BarInt(b=2,a=1)
if b.bar(b=1,a=2) != 3:
raise RuntimeError
if BarInt.statbar(b=2) != 3:
raise RuntimeError
if b.ebar(b=2) != 3:
raise RuntimeError
if BarInt.sbar(b=2) != 3:
raise RuntimeError
# Functions
if templatedfunction(b=2) != 3:
raise RuntimeError
if foo(a=1,b=2) != 3:
raise RuntimeError
if foo(b=2) != 3:
raise RuntimeError