Salome HOME
Update copyrights
[modules/shaper.git] / src / SketchPlugin / Test / TestHighload.py
index 82075373941b56c8f5f03bbc14f4c920afbbd744..63bbbbaa658471519c07cc9108f02fbf75b011a9 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
+#
+
 """
     TestHighload.py
 """
@@ -24,7 +43,7 @@ def createNAngle(theSketch, theN, theRadius, theEdgeLength=0):
     # Create an N-Angle at (0,0)
     rad = 2. * math.pi / theN
     points = []
-    for a in xrange(theN):
+    for a in range(theN):
         x = round(math.cos(rad * a), 10) * theRadius
         y = round(math.sin(rad * a), 10) * theRadius
         points.append((x, y))
@@ -102,14 +121,16 @@ aSession.finishOperation()
 #=========================================================================
 # Create 4x4 polygons N = {5, 21}
 #=========================================================================
+aDOF = 0
 deltaX = deltaY = 50.
 n = 5
 aSession.startOperation()
-for i in xrange(4):
-    for j in xrange(4):
+for i in range(4):
+    for j in range(4):
         allNangleLines = createNAngle(aSketchFeature, n, 50)
         fixLineLength(aSketchFeature, allNangleLines)
         moveTo(allNangleLines, deltaX, deltaY)
+        aDOF += n
         n += 1
         deltaX += 110.
     deltaY += 110.
@@ -121,5 +142,6 @@ aSession.finishOperation()
 # End of test
 #=========================================================================
 
-import model
+from salome.shaper import model
+assert(model.dof(aSketchFeature) == aDOF)
 assert(model.checkPythonDump())