Salome HOME
Update projected coordinate axes when changing one coordinate plane to another.
[modules/shaper.git] / src / SketchPlugin / Test / TestCreateCircleChangeType.py
index 4a78584aa365d924d9175727f43f545253614445..aa49c3a1e4e8235df7f3b833ba19a375c6da5490 100644 (file)
@@ -1,3 +1,22 @@
+# 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
+#
+
 """
     TestCreateCircleChangeType.py
 
@@ -23,9 +42,7 @@ __updated__ = "2017-03-22"
 
 def assertNotInitializedByCenterAndPassed(theMacroCircle):
     # check points
-    aCenterPoint = geomDataAPI_Point2D(theMacroCircle.attribute("center_point"))
     aPassedPoint = geomDataAPI_Point2D(theMacroCircle.attribute("passed_point"))
-    assert (not aCenterPoint.isInitialized())
     assert (not aPassedPoint.isInitialized())
     # check references
     aCenterPointRef = theMacroCircle.refattr("center_point_ref")
@@ -54,13 +71,7 @@ def verifyLastCircle(theSketch, theX, theY, theR):
     subroutine to verify position of last circle in the sketch
     """
     aLastCircle = model.lastSubFeature(theSketch, "SketchCircle")
-    aCenter = geomDataAPI_Point2D(aLastCircle.attribute("circle_center"))
-    verifyPointCoordinates(aCenter, theX, theY)
-    aRadius = aLastCircle.real("circle_radius")
-    assert aRadius.value() == theR, "Wrong radius {0}, expected {1}".format(aRadius.value(), theR)
-
-def verifyPointCoordinates(thePoint, theX, theY):
-    assert thePoint.x() == theX and thePoint.y() == theY, "Wrong '{0}' point ({1}, {2}), expected ({3}, {4})".format(thePoint.attributeType(), thePoint.x(), thePoint.y(), theX, theY)
+    model.assertCircle(aLastCircle, [theX, theY], theR)
 
 
 #=========================================================================