Salome HOME
Copyright update 2022
[modules/shaper.git] / src / ModelAPI / Test / TestFolder_Create.py
index 36d429a6a8514732facc477677fd9abf00a32256..f557847cf1b5e596be6cf9fb90b7a32d691740cd 100644 (file)
@@ -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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2022  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())