]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelAPI/Test/TestMovePart1.py
Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelAPI / Test / TestMovePart1.py
index f05d0e91c3e6f6561ada6eaea06f728c21dc46cc..8f90e0fd1dced20d26a47daf7f1ee8db38e07d7e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2021  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
@@ -76,9 +76,18 @@ def checkMovement(theWhat, theTo, theError):
   aListCheck = theError.split('\n')
   aListGet = anError.split('\n')
   assert(len(aListCheck) == len(aListGet))
+  # sort the second part of received list strings by name to keep stability of tests
+  aListGetSort = []
+  for aLGet in aListGet:
+    if aLGet.find("-> ") > 0:
+      aRightPart = aLGet.split('-> ')[1].split(' ')
+      aRightPart.sort()
+      aListGetSort.append(aLGet.split('-> ')[0] + '-> ' + ' '.join(aRightPart))
+    else:
+      aListGetSort.append(aLGet)
   for anErr in aListCheck:
     #print("Looking for " + anErr + " in " + str(aListGet))
-    assert(aListGet.count(anErr) == 1)
+    assert(aListGetSort.count(anErr) == 1)
 
 # movement to very first location actually means movement after the first invisible objects, coordinate system hidden ones
 aLastHidden = None
@@ -97,7 +106,7 @@ checkMovement(Part_1, Part_3, 'Placement_1 -> Part_1')
 
 checkMovement(Part_2, None, 'Part_2 -> Origin Sketch_1 Sketch_2')
 checkMovement(Part_2, aLastHidden, 'Part_2 -> Sketch_1 Sketch_2')
-checkMovement(Part_2, Sketch_1, 'Part_2 -> Sketch_2 Sketch_1') # in GUI this is not the case, because it drops after invisible sketch components
+checkMovement(Part_2, Sketch_1, 'Part_2 -> Sketch_1 Sketch_2') # in GUI this is not the case, because it drops after invisible sketch components
 checkMovement(Part_2, Sketch_2, 'Part_2 -> Sketch_2') # in GUI this is not the case, because it drops after invisible sketch components
 checkMovement(Part_2, Part_1, '')
 checkMovement(Part_2, Placement_1, 'Placement_1 -> Part_2')