From: Renaud NEDELEC Date: Wed, 14 Oct 2015 10:14:11 +0000 (+0200) Subject: [PythonAPI] added a first test case for the modeler API X-Git-Tag: V_2.1.0~206^2~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ccb49298680ec8547d0497103f09b9a3cc5e270;p=modules%2Fshaper.git [PythonAPI] added a first test case for the modeler API --- diff --git a/src/PythonAPI/modeler/tests/CMakeLists.txt b/src/PythonAPI/modeler/tests/CMakeLists.txt new file mode 100644 index 000000000..c42456c7c --- /dev/null +++ b/src/PythonAPI/modeler/tests/CMakeLists.txt @@ -0,0 +1,2 @@ +enable_testing() +add_test(NAME "test_modeler" COMMAND "python" "modeler_test_case.py") diff --git a/src/PythonAPI/modeler/tests/modeler_test_case.py b/src/PythonAPI/modeler/tests/modeler_test_case.py new file mode 100644 index 000000000..347aa5afe --- /dev/null +++ b/src/PythonAPI/modeler/tests/modeler_test_case.py @@ -0,0 +1,18 @@ +import unittest +import modeler + +class ModelerTestCase(unittest.TestCase): + def setUp(self): + modeler.begin() + partset = modeler.moduleDocument() + self.part = modeler.addPart(partset).document() + + def tearDown(self): + modeler.end() + + def test_add_sketch(self): + plane = modeler.defaultPlane("XOY") + modeler.addSketch(self.part, plane) + +if __name__ == "__main__": + unittest.main() diff --git a/src/PythonAPI/modeler/tests/test_sketcher.py b/src/PythonAPI/modeler/tests/test_sketcher.py new file mode 100644 index 000000000..b1f641b31 --- /dev/null +++ b/src/PythonAPI/modeler/tests/test_sketcher.py @@ -0,0 +1,14 @@ +import unittest +import modeler + +class TestSketcher(unittest.TestCase): + def test_init_sketch(self): + modeler.begin() + partset = modeler.moduleDocument() + part = modeler.addPart(partset).document() + plane = modeler.defaultPlane("XOY") + modeler.addSketch(part, plane) + modeler.end() + +if __name__ == "__main__": + unittest.main()