X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FTest%2FTestConstraintHorizontal.py;h=a276e4e4dd2fe7994fc4c555bb5f1dbe482da0ab;hb=964cad2613a9a40164fcdac4fc62c73a65244465;hp=f0a55dfe755d3a64368dee4776a3889f33b733aa;hpb=ee6034427d4adc3b83cad729e641537382576ab4;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/Test/TestConstraintHorizontal.py b/src/SketchPlugin/Test/TestConstraintHorizontal.py index f0a55dfe7..a276e4e4d 100644 --- a/src/SketchPlugin/Test/TestConstraintHorizontal.py +++ b/src/SketchPlugin/Test/TestConstraintHorizontal.py @@ -1,7 +1,27 @@ +## 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 +## + """ TestConstraintHorizontal.py Unit test of SketchPlugin_ConstraintHorizontal class - + SketchPlugin_ConstraintHorizontal static const std::string MY_CONSTRAINT_HORIZONTAL_ID("SketchConstraintHorizontal"); data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); @@ -9,6 +29,8 @@ """ from GeomDataAPI import * from ModelAPI import * +from salome.shaper import model + #========================================================================= # Initialization of the test #========================================================================= @@ -40,6 +62,7 @@ aLineEndPoint = geomDataAPI_Point2D(aSketchLine.attribute("EndPoint")) aLineStartPoint.setValue(0., 15.) aLineEndPoint.setValue(20., 25.) aSession.finishOperation() +assert(model.dof(aSketchFeature) == 4) #========================================================================= # Assign horizontal constraint for a line #========================================================================= @@ -52,6 +75,7 @@ refattrA.setObject(aResult) aHorizontalConstraint.execute() aSession.finishOperation() assert(aLineStartPoint.y() == aLineEndPoint.y()) +assert(model.dof(aSketchFeature) == 3) #========================================================================= # Move one of boundary points of a line #========================================================================= @@ -61,6 +85,7 @@ aLineStartPoint.setValue(aLineStartPoint.x() + deltaX, aLineStartPoint.y() + deltaY) aSession.finishOperation() assert(aLineStartPoint.y() == aLineEndPoint.y()) +assert(model.dof(aSketchFeature) == 3) #========================================================================= # Move other boundary point of a line #========================================================================= @@ -71,9 +96,9 @@ aLineEndPoint.setValue(aLineEndPoint.x() + deltaX, aLineEndPoint.y() + deltaY) aSession.finishOperation() assert(aLineStartPoint.y() == aLineEndPoint.y()) +assert(model.dof(aSketchFeature) == 3) #========================================================================= # End of test #========================================================================= -from salome.shaper import model assert(model.checkPythonDump())