From 939a2b895b2a5f4213d69b14b1498efbd3d572e6 Mon Sep 17 00:00:00 2001 From: Renaud NEDELEC Date: Wed, 14 Oct 2015 18:03:25 +0200 Subject: [PATCH] [PythonAPI] reorganised sketcher API tests --- src/PythonAPI/CMakeLists.txt | 3 ++- src/PythonAPI/Test/TestSketcher.py | 13 ------------- src/PythonAPI/Test/TestSketcherAddLine.py | 10 ++++++++++ src/PythonAPI/Test/TestSketcherSetCoincident.py | 12 ++++++++++++ 4 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 src/PythonAPI/Test/TestSketcherAddLine.py create mode 100644 src/PythonAPI/Test/TestSketcherSetCoincident.py diff --git a/src/PythonAPI/CMakeLists.txt b/src/PythonAPI/CMakeLists.txt index ac9909369..ca494a0b1 100644 --- a/src/PythonAPI/CMakeLists.txt +++ b/src/PythonAPI/CMakeLists.txt @@ -10,5 +10,6 @@ INCLUDE(UnitTest) ADD_UNIT_TESTS( TestModeler.py - TestSketcher.py + TestSketcherAddLine.py + TestSketcherSetCoincident.py ) diff --git a/src/PythonAPI/Test/TestSketcher.py b/src/PythonAPI/Test/TestSketcher.py index ece5331de..f187c28b9 100644 --- a/src/PythonAPI/Test/TestSketcher.py +++ b/src/PythonAPI/Test/TestSketcher.py @@ -11,16 +11,3 @@ class SketcherTestCase(unittest.TestCase): 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() diff --git a/src/PythonAPI/Test/TestSketcherAddLine.py b/src/PythonAPI/Test/TestSketcherAddLine.py new file mode 100644 index 000000000..959827a6a --- /dev/null +++ b/src/PythonAPI/Test/TestSketcherAddLine.py @@ -0,0 +1,10 @@ +import unittest +import modeler +from TestSketcher import SketcherTestCase + +class SketcherAddLineTestCase(SketcherTestCase): + def runTest(self): + self.sketch.addLine(0, 0, 0, 1) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetCoincident.py b/src/PythonAPI/Test/TestSketcherSetCoincident.py new file mode 100644 index 000000000..0b4cae6c3 --- /dev/null +++ b/src/PythonAPI/Test/TestSketcherSetCoincident.py @@ -0,0 +1,12 @@ +import unittest +import modeler +from TestSketcher import SketcherTestCase + +class SketcherSetCoincident(SketcherTestCase): + def runTest(self): + 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() \ No newline at end of file -- 2.39.2