From: dbv Date: Wed, 7 Sep 2016 14:38:37 +0000 (+0300) Subject: Test for rectangle feature X-Git-Tag: V_2.5.0~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=db228e5caa8123d251e0c9df72c1ebc2e977d96a;hp=e552adb9a5f70d4d112107cdb6a0551048b765f1;p=modules%2Fshaper.git Test for rectangle feature --- diff --git a/src/PythonAddons/CMakeLists.txt b/src/PythonAddons/CMakeLists.txt index b6704ac65..a79a28cb5 100644 --- a/src/PythonAddons/CMakeLists.txt +++ b/src/PythonAddons/CMakeLists.txt @@ -26,3 +26,9 @@ INSTALL(FILES __init__.py DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(DIRECTORY macros DESTINATION ${SHAPER_INSTALL_ADDONS}) INSTALL(DIRECTORY macros/box/icons/ macros/rectangle/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons) INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) + +INCLUDE(UnitTest) + +ADD_UNIT_TESTS( + TestRectangle.py +) diff --git a/src/PythonAddons/Test/TestRectangle.py b/src/PythonAddons/Test/TestRectangle.py new file mode 100644 index 000000000..0efe470f6 --- /dev/null +++ b/src/PythonAddons/Test/TestRectangle.py @@ -0,0 +1,17 @@ +import model +import geom + +model.begin() +partSet = model.moduleDocument() +part = model.addPart(partSet).document() + +sketch = model.addSketch(part, model.defaultPlane("XOY")) +rectangle_1 = sketch.addRectangle(0, 0, 50, 50) + +startPoint = geom.Pnt2d(50, 50) +endPoint = geom.Pnt2d(100, 100) + +rectangle_2 = sketch.addRectangle(startPoint, endPoint) +model.end() + +assert(model.checkPythonDump())