swig/Examples/test-suite/python/template_classes_runme.py
William S Fulton d4ffa46f41 Convert python tests using 2to3
These tests were converted using 2to3 and should be valid using
Python 2.7 and Python 3+.
2020-08-15 00:16:04 +01:00

44 lines
867 B
Python

from template_classes import *
# This test is just testing incorrect number of arguments/parameters checking
point = PointInt()
rectangle = RectangleInt()
rectangle.setPoint(point)
rectangle.getPoint()
RectangleInt.static_noargs()
RectangleInt.static_onearg(1)
fail = True
try:
rectangle.setPoint()
except TypeError as e:
fail = False
if fail:
raise RuntimeError("argument count check failed")
fail = True
try:
rectangle.getPoint(0)
except TypeError as e:
fail = False
if fail:
raise RuntimeError("argument count check failed")
fail = True
try:
RectangleInt.static_noargs(0)
except TypeError as e:
fail = False
if fail:
raise RuntimeError("argument count check failed")
fail = True
try:
RectangleInt.static_onearg()
except TypeError as e:
fail = False
if fail:
raise RuntimeError("argument count check failed")