From: Renaud NEDELEC Date: Thu, 5 Nov 2015 12:57:40 +0000 (+0100) Subject: [PythonAPI / sketcher] added missing test (tangent constraint) X-Git-Tag: V_2.1.0~206^2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9df00be366a8be8abe30e4eb64404d4a91775519;p=modules%2Fshaper.git [PythonAPI / sketcher] added missing test (tangent constraint) --- diff --git a/src/PythonAPI/Test/TestSketcherSetTangent.py b/src/PythonAPI/Test/TestSketcherSetTangent.py new file mode 100644 index 000000000..5b0959fd2 --- /dev/null +++ b/src/PythonAPI/Test/TestSketcherSetTangent.py @@ -0,0 +1,24 @@ +import unittest +import model +from TestSketcher import SketcherTestCase + +class SketcherSetTangent(SketcherTestCase): + def setUp(self): + SketcherTestCase.setUp(self) + self.line = self.sketch.addLine(0, 0, 0, 1) + self.arc = self.sketch.addArc(0, 1, 0, 0, 1, 1) + self.sketch.setCoincident( + self.line.endPointData(), self.arc.startPointData() + ) + + def test_set_tangent(self): + self.sketch.setTangent(self.line.result(), self.arc.result()) + model.do() + # TODO : find a way to check that the constraint as been set + + def test_none_type_arguments(self): + with self.assertRaises(TypeError): + self.sketch.setTangent(None, self.arc.result()) + +if __name__ == "__main__": + unittest.main(verbosity=2) \ No newline at end of file