/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/template_classes_runme.py
44 строки
867 B
William S Fulton
Convert python tests using 2to3
15 авг 2020, 02:16
15 авг 2020, 02:16
d4ffa46
Код
Авторство
О чём код?
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")