Salome HOME
Update the test due to the API changes
authormpv <mpv@opencascade.com>
Fri, 17 Apr 2015 14:50:48 +0000 (17:50 +0300)
committermpv <mpv@opencascade.com>
Fri, 17 Apr 2015 14:50:48 +0000 (17:50 +0300)
src/ModelAPI/Test/TestDocument.py

index d3693974e5f2abb6e856b9eeff5cf3ad7b59a549..e0f7da4be1b910f394de5d1502248c4733531652 100644 (file)
@@ -62,7 +62,7 @@ assert(aPart.size("Features") == 1)
 # Duplicate the document
 assert(aSession.moduleDocument().size("Parts") == 1)
 aSession.startOperation()
-aSession.moduleDocument().addFeature("Duplicate")
+aPart.addFeature("Duplicate")
 aSession.finishOperation()
 assert(aSession.moduleDocument().size("Parts") == 2)
 aCopyOfPart = aSession.activeDocument()
@@ -75,7 +75,7 @@ assert(aCopyOfPart != aPart)
 #=========================================================================
 assert(aSession.moduleDocument().size("Parts") == 2)
 aSession.startOperation()
-aSession.moduleDocument().addFeature("Remove")
+aPart.addFeature("Remove")
 aSession.finishOperation()
 assert(aSession.moduleDocument().size("Parts") == 1)
 assert(aSession.activeDocument().id() == aSession.moduleDocument().id())
@@ -83,23 +83,7 @@ assert(aSession.activeDocument().id() == aSession.moduleDocument().id())
 aSession.startOperation()
 aDoc1 = aSession.document("Part_1")
 aSession.setActiveDocument(aDoc1, False)
-aSession.moduleDocument().addFeature("Remove")
+aDoc1.addFeature("Remove")
 aSession.finishOperation()
 assert(aSession.moduleDocument().size("Parts") == 0)
 assert(aSession.activeDocument())
-#=========================================================================
-# Trying to duplicate/remove the root
-#=========================================================================
-aSession.startOperation()
-aSession.moduleDocument().addFeature("Duplicate")
-aSession.finishOperation()
-assert(aSession.activeDocument().id() == aSession.moduleDocument().id())
-assert(aSession.moduleDocument().size("Parts") == 0)
-aSession.startOperation()
-aSession.moduleDocument().addFeature("Remove")
-aSession.finishOperation()
-assert(aSession.activeDocument().id() == aSession.moduleDocument().id())
-assert(aSession.moduleDocument().size("Parts") == 0)
-#=========================================================================
-# End of test
-#=========================================================================