Salome HOME
testHaveNamingSubshapes: Do not create a group if there is no objects of specified...
authorazv <azv@opencascade.com>
Wed, 17 Jan 2018 09:24:19 +0000 (12:24 +0300)
committerazv <azv@opencascade.com>
Wed, 17 Jan 2018 09:24:48 +0000 (12:24 +0300)
src/PythonAPI/model/tests/tests.py

index 6c6d8e89907a2aab5bd169b4306c17e43eca94aa..ff7ce4dddedba4ee5d7a50b337c0b9d754370673 100644 (file)
@@ -238,6 +238,9 @@ def testHaveNamingByType(theFeature, theModel, thePartDoc, theSubshapeType) :
       selectionList.append(selection)
       shapeExplorer.next()
   # Create group with this selection list
+  # (do not create group if nothing is selected)
+  if (len(selectionList) == 0):
+    return
   Group_1 = theModel.addGroup(thePartDoc, selectionList)
   theModel.do()