From: azv Date: Mon, 7 Oct 2019 13:47:57 +0000 (+0300) Subject: Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003) X-Git-Tag: V9_4_0a2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9efe44a58ba2dfbcec9de54a644fda867d187987;p=modules%2Fshaper.git Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003) Improve code coverage. --- diff --git a/src/SketchPlugin/Test/TestConstraintCoincidenceEllipticArc.py b/src/SketchPlugin/Test/TestConstraintCoincidenceEllipticArc.py index c7eb7798f..5bad30fa8 100644 --- a/src/SketchPlugin/Test/TestConstraintCoincidenceEllipticArc.py +++ b/src/SketchPlugin/Test/TestConstraintCoincidenceEllipticArc.py @@ -258,6 +258,43 @@ class TestCoincidenceEllipticArc(unittest.TestCase): self.checkPointOnEllipse(self.myOrigin.coordinates(), self.myEllipticArc) + def test_start_on_major_axis(self): + """ Test 22. Make coincident the start point of the arc and the end of its major axis + """ + self.myEllipticArc.startPoint().setValue(38, -2) + model.do() + self.mySketch.setCoincident(self.myEllipticArc.startPoint(), self.myMajorAxis.endPoint()) + self.myDOF -= 1 + model.do() + self.assertPoints(self.myMajorAxis.endPoint(), self.myEllipticArc.startPoint()) + + def test_end_on_major_axis(self): + """ Test 23. Make coincident the end point of the arc and the start of its major axis + """ + self.myEllipticArc.endPoint().setValue(-58, 12) + model.do() + self.mySketch.setCoincident(self.myMajorAxis.startPoint(), self.myEllipticArc.endPoint()) + self.myDOF -= 1 + model.do() + self.assertPoints(self.myMajorAxis.startPoint(), self.myEllipticArc.endPoint()) + + def test_start_on_minor_axis(self): + """ Test 22. Make coincident the start point of the arc and the end of its minor axis + """ + self.mySketch.setCoincident(self.myMinorAxis.endPoint(), self.myEllipticArc.startPoint()) + self.myDOF -= 1 + model.do() + self.assertPoints(self.myMinorAxis.endPoint(), self.myEllipticArc.startPoint()) + + def test_end_on_minor_axis(self): + """ Test 23. Make coincident the end point of the arc and the start of its minor axis + """ + self.mySketch.setCoincident(self.myEllipticArc.endPoint(), self.myMinorAxis.startPoint()) + self.myDOF -= 1 + model.do() + self.assertPoints(self.myMinorAxis.startPoint(), self.myEllipticArc.endPoint()) + + if __name__ == "__main__": test_program = unittest.main(exit=False) assert test_program.result.wasSuccessful(), "Test failed"