Salome HOME
Update copyrights
[modules/shaper.git] / src / SketchPlugin / Test / Test1673.py
index ea06d67c0377b86e7a94476c63429f9bc20f815b..a534a0cccde7b849d9ff48c571724b2694de22be 100644 (file)
@@ -1,22 +1,21 @@
-## 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>
-##
+# Copyright (C) 2014-2019  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
+#
 
 """
     Test1673.py
@@ -248,13 +247,16 @@ SketchConstraintVertical_11.setName("SketchConstraintVertical_12")
 model.do()
 
 sketchTime = timer() - sketchTime
-print "Sketch creation time: {0}".format(sketchTime)
+print("Sketch creation time: {0}".format(sketchTime))
 expectedTime = MOVE_BUILD_RATIO * sketchTime
 averageTime = 0
 nbMoves = 0
 
-# Sketch is overconstrained, check the message
-assert Sketch_1.solverError().value() != "", "FAILED: Sketch should report over-constrained situation"
+# Two vertical constraints: due to #1889 the sketch is invalid now, not overconstrained
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(not aFactory.validate(SketchConstraintVertical_10.feature()))
+#assert Sketch_1.solverError().value() != "", "FAILED: Sketch should report over-constrained situation"
 
 # Remove duplicated Vertical constraints
 Part_1_doc.removeFeature(SketchConstraintVertical_10.feature())
@@ -286,7 +288,7 @@ for ang in range(0, 50):
     nbMoves += 1
     aDeltaX = aEndPoint.x() - aCenter.x()
     aDeltaY = aEndPoint.y() - aCenter.y()
-print "Movement average time: {0}".format(averageTime / nbMoves)
+print("Movement average time: {0}".format(averageTime / nbMoves))
 
 model.end()