From e3805ddb536f72f21b249390b90f1fc14c63e98e Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 7 Oct 2019 16:47:57 +0300 Subject: [PATCH] Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003) Improve code coverage. --- .../TestConstraintCoincidenceEllipticArc.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) 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" -- 2.39.2