Salome HOME
updated copyright message
[modules/shaper.git] / src / ConnectorAPI / Test / TestExportToGEOMPartSet.py
index 77d5478ba34960ef0ffdf3de500f810475ce389f..461fed024f5c0a8f89a5bbcef6939f783f2cd8b8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+# Copyright (C) 2014-2023  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -21,11 +21,12 @@ import salome
 from ModelAPI import *
 from salome.shaper import model
 
-from salome.geom import geomBuilder
 
 import os
 import tempfile
 
+salome.standalone()
+from salome.geom import geomBuilder
 salome.salome_init(1)
 geompy = geomBuilder.New()
 
@@ -42,7 +43,7 @@ def getGEOMShape(index):
       sobj = iterator.Value()
       iterator.Next()
       i = i - 1
-    if sobj:
+    if i == 0 and sobj:
       obj = sobj.GetObject()
   else:
     raise Exception("GEOM component " + str(index) + " not found.")
@@ -114,7 +115,7 @@ model.begin()
 model.exportToGEOM(Part_1_doc)
 model.end()
 
-# check that in GEOM module there are reuslts:
+# check that in GEOM module there are results:
 # extrusion of the first part
 # extrusion with group of the second part
 # extrusion with filed of the third part
@@ -141,7 +142,7 @@ assert(geompy.NumberOfSubShapes(shape3, geompy.ShapeType["VERTEX"]) == 3)
 field = salome.ObjectToSObject(shape3).FindSubObject(1)[1].GetObject()
 assert(field)
 assert(field.GetName() == "Field_1")
-assert(field.GetSteps() == [0, 1])
+assert(field.GetSteps() == [1, 2])
 
 shape4 = getGEOMShape(3)
 assert(not shape4)