X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FTest%2FTestFolder_Create.py;h=1fb2eb99daba9bdc20d2f154faabc6c8a224dcb2;hb=a2e697d6efc2f36155ad2236ec52915b59cce738;hp=36d429a6a8514732facc477677fd9abf00a32256;hpb=2714903267d23cd0c81166c506fb3edd1e069d40;p=modules%2Fshaper.git diff --git a/src/ModelAPI/Test/TestFolder_Create.py b/src/ModelAPI/Test/TestFolder_Create.py index 36d429a6a..1fb2eb99d 100644 --- a/src/ModelAPI/Test/TestFolder_Create.py +++ b/src/ModelAPI/Test/TestFolder_Create.py @@ -1,27 +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 -## +# 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 +# #========================================================================= # Initialization of the test #========================================================================= from ModelAPI import * +from GeomDataAPI import * __updated__ = "2017-11-22" @@ -35,9 +35,7 @@ aSession.startOperation() aPoint0 = aPartSetDoc.addFeature("Point") aPoint0Data = aPoint0.data() assert(aPoint0Data is not None) -aPoint0Data.real("x").setValue(0.) -aPoint0Data.real("y").setValue(0.) -aPoint0Data.real("z").setValue(0.) +geomDataAPI_Point(aPoint0Data.attribute("point3d")).setValue(0., 0., 0.) aPoint0Data.string("creation_method").setValue("by_xyz") aSession.finishOperation() @@ -45,9 +43,7 @@ aSession.startOperation() aPoint1 = aPartSetDoc.addFeature("Point") aPoint1Data = aPoint1.data() assert(aPoint1Data is not None) -aPoint1Data.real("x").setValue(0.) -aPoint1Data.real("y").setValue(0.) -aPoint1Data.real("z").setValue(0.) +geomDataAPI_Point(aPoint1Data.attribute("point3d")).setValue(0., 0., 0.) aPoint1Data.string("creation_method").setValue("by_xyz") aSession.finishOperation() @@ -87,9 +83,7 @@ aSession.startOperation() aPoint2 = aPartDoc.addFeature("Point") aPoint2Data = aPoint2.data() assert(aPoint2Data is not None) -aPoint2Data.real("x").setValue(0.) -aPoint2Data.real("y").setValue(0.) -aPoint2Data.real("z").setValue(0.) +geomDataAPI_Point(aPoint2Data.attribute("point3d")).setValue(0., 0., 0.) aPoint2Data.string("creation_method").setValue("by_xyz") aSession.finishOperation() @@ -103,6 +97,3 @@ assert(aPartDoc.size("Folders") == 1), "Wrong number of folders: {}".format(aPar assert(aPartDoc.size("Features") == 2), "Wrong number of features: {}".format(aPartDoc.size("Features")) FOLDER_NAME_EXPECTED = "Folder_1" assert(aFolder2.name() == FOLDER_NAME_EXPECTED), "Actual name '{}', expected '{}'".format(aFolder2.name(), FOLDER_NAME_EXPECTED) - -from salome.shaper import model -assert(model.checkPythonDump())