SET(CMAKE_AUTOMOC ON)
INSTALL(DIRECTORY extension geom modeler DESTINATION pythonAPI)
+
+# --------- Unit tests -----------
+INCLUDE(UnitTest)
+
+ADD_UNIT_TESTS(
+ TestModeler.py
+ TestSketcher.py
+ )
--- /dev/null
+enable_testing()
+add_test(NAME "test_modeler" COMMAND "python" "modeler_test_case.py")
--- /dev/null
+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()
--- /dev/null
+import unittest
+import modeler
+
+class SketcherTestCase(unittest.TestCase):
+ def setUp(self):
+ modeler.begin()
+ partset = modeler.moduleDocument()
+ part = modeler.addPart(partset).document()
+ plane = modeler.defaultPlane("XOY")
+ self.sketch = modeler.addSketch(part, plane)
+
+ def tearDown(self):
+ modeler.end()
+
+ def test_add_line(self):
+ print "add_line"
+ self.sketch.addLine(0, 0, 0, 1)
+
+ def test_set_coincident(self):
+ print "set_coincident"
+ l1 = self.sketch.addLine(0, 0, 0, 1)
+ l2 = self.sketch.addLine(0, 1, 1, 1)
+ self.sketch.setCoincident(l1.endPointData(), l2.startPointData())
+
+if __name__ == "__main__":
+ unittest.main()
--- /dev/null
+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()
+++ /dev/null
-enable_testing()
-add_test(NAME "test_modeler" COMMAND "python" "modeler_test_case.py")
+++ /dev/null
-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()
+++ /dev/null
-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()
+++ /dev/null
-enable_testing()
-add_test(NAME "test" COMMAND "python" "test.py")
+++ /dev/null
-import unittest
-
-class Test(unittest.TestCase):
- def test_assert_false(self):
- self.assertFalse(False)
-
-if __name__ == "__main__":
- unittest.main()