]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] added a first test case for the modeler API
authorRenaud NEDELEC <renaud.nedelec@opencascade.com>
Wed, 14 Oct 2015 10:14:11 +0000 (12:14 +0200)
committerRenaud NEDELEC <renaud.nedelec@opencascade.com>
Wed, 14 Oct 2015 10:14:11 +0000 (12:14 +0200)
src/PythonAPI/modeler/tests/CMakeLists.txt [new file with mode: 0644]
src/PythonAPI/modeler/tests/modeler_test_case.py [new file with mode: 0644]
src/PythonAPI/modeler/tests/test_sketcher.py [new file with mode: 0644]

diff --git a/src/PythonAPI/modeler/tests/CMakeLists.txt b/src/PythonAPI/modeler/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c42456c
--- /dev/null
@@ -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 (file)
index 0000000..347aa5a
--- /dev/null
@@ -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 (file)
index 0000000..b1f641b
--- /dev/null
@@ -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()