From: Artem Zhidkov Date: Wed, 7 Apr 2021 19:58:53 +0000 (+0300) Subject: Update test for centered rectangle to check modification of center point and corner. X-Git-Tag: V9_7_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77044a4e03fa64c8cb8228dd6531ecc27d4773c4;p=modules%2Fshaper.git Update test for centered rectangle to check modification of center point and corner. --- 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())