From 77044a4e03fa64c8cb8228dd6531ecc27d4773c4 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Wed, 7 Apr 2021 22:58:53 +0300 Subject: [PATCH] Update test for centered rectangle to check modification of center point and corner. --- .../Test/TestRectangleCentered.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/PythonAddons/Test/TestRectangleCentered.py b/src/PythonAddons/Test/TestRectangleCentered.py index ff47827f0..e8ec4a2c7 100644 --- a/src/PythonAddons/Test/TestRectangleCentered.py +++ b/src/PythonAddons/Test/TestRectangleCentered.py @@ -72,4 +72,25 @@ model.end() checkRectangle(lines_3, SketchAPI_Line(lines_1[0]).startPoint().pnt(), SketchAPI_Line(lines_2[0]).endPoint().pnt()) +# move center of rectangle +SHIFT = 1.0 +center = SketchAPI_Line(lines_1[0]).startPoint().pnt() +for i in range(0, 20): + center.setX(center.x() + SHIFT) + center.setY(center.y() + SHIFT) + model.begin() + sketch.move(SketchAPI_Line(lines_1[0]).startPoint(), center) + model.end() + checkRectangle(lines_3, center, SketchAPI_Line(lines_2[0]).endPoint().pnt()) + +# move corner of rectangle +corner = SketchAPI_Line(lines_2[0]).endPoint().pnt() +for i in range(0, 20): + corner.setX(corner.x() + SHIFT) + corner.setY(corner.y() + SHIFT) + model.begin() + sketch.move(SketchAPI_Line(lines_2[0]).endPoint(), corner) + model.end() + checkRectangle(lines_3, SketchAPI_Line(lines_1[0]).startPoint().pnt(), corner) + assert(model.checkPythonDump()) -- 2.39.2