Salome HOME
Fix for the #1757 with full split of the selected sketch-face.
[modules/shaper.git] / src / SketchPlugin / Test / TestRectangle.py
index aafdd9c1c8fef82f71c803856ca8e4609a08d94c..cbb9b3cc7d02bad28ceddec7d1334d39f3a8f606 100644 (file)
@@ -1,3 +1,23 @@
+## 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>
+##
+
 """
     TestRectangle.py
     Unit test of SketchPlugin_Ractangle class
@@ -6,6 +26,8 @@
 from GeomDataAPI import *
 from ModelAPI import *
 import math
+from salome.shaper import model
+
 #=========================================================================
 # Initialization of the test
 #=========================================================================
@@ -66,6 +88,7 @@ for i in range (0, aNbSubs):
         assert (isHorizontal(aLastLine) or isVertical(aLastLine))
         aNbLines = aNbLines + 1
 assert (aNbLines == 4)
+assert (model.dof(aSketchFeature) == 4)
 #=========================================================================
 # Move one of lines
 #=========================================================================
@@ -76,15 +99,18 @@ aSession.finishOperation()
 #=========================================================================
 # Check the lines of rectangle are parallel to the axes
 #=========================================================================
-#aNbSubs = aSketchFeature.numberOfSubs()
-#aNbLines = 0
-#for i in range (0, aNbSubs):
-#    aFeature = objectToFeature(aSketchFeature.subFeature(i))
-#    if aFeature.getKind() == "SketchLine":
-#        aLastLine = aFeature
-#        assert (isHorizontal(aLastLine) or isVertical(aLastLine))
-#        aNbLines = aNbLines + 1
-#assert (aNbLines == 4)
+aNbSubs = aSketchFeature.numberOfSubs()
+aNbLines = 0
+for i in range (0, aNbSubs):
+    aFeature = objectToFeature(aSketchFeature.subFeature(i))
+    if aFeature.getKind() == "SketchLine":
+        aLastLine = aFeature
+        assert (isHorizontal(aLastLine) or isVertical(aLastLine))
+        aNbLines = aNbLines + 1
+assert (aNbLines == 4)
+assert (model.dof(aSketchFeature) == 4)
 #=========================================================================
 # End of test
 #=========================================================================
+
+assert(model.checkPythonDump())