]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add more tests for update of the sketcher behavior check
authormpv <mpv@opencascade.com>
Tue, 9 Jan 2018 15:01:44 +0000 (18:01 +0300)
committermpv <mpv@opencascade.com>
Tue, 9 Jan 2018 15:01:44 +0000 (18:01 +0300)
src/ModelAPI/CMakeLists.txt
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/Test/Test2062.py [new file with mode: 0644]

index aa0b87e0ce66083fec1b5cf8caf75cd63307291e..7393fd02d2ea43858c5e072ec083952044d83b3a 100644 (file)
@@ -174,6 +174,7 @@ ADD_UNIT_TESTS(TestConstants.py
                Test2241.py
                Test2252.py
                Test2276.py
+               Test2391.py
                TestCustomName_BooleanCut.py
                TestCustomName_CommonCompSolid.py
                TestCustomName_CutCompSolid.py
index 1391e252af2ec1648c3c28ec40e872610f83874d..55e8b72f6b0d5db2ef394a8da3f5fe460081dcc3 100644 (file)
@@ -198,6 +198,7 @@ ADD_UNIT_TESTS(TestSketchPointLine.py
                Test1924.py
                Test1966.py
                Test1967.py
+               Test2062.py
                Test2095.py
                Test2115.py
                TestTrimArc01.py
diff --git a/src/SketchPlugin/Test/Test2062.py b/src/SketchPlugin/Test/Test2062.py
new file mode 100644 (file)
index 0000000..aa323b8
--- /dev/null
@@ -0,0 +1,38 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(10, 10, 10, 100)
+SketchLine_2 = Sketch_1.addLine(10, 100, 100, 10)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+model.do()
+# make non-perpendicular line perpendicular
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_2.result())
+model.do()
+# this moves the line
+assert(SketchLine_1.startPoint().x() != 10)
+model.end()
+model.undo()
+# undo must move the line exactly back
+assert(SketchLine_1.startPoint().x() == 10)