[commit] r1091 - trunk/Tests/GPyUnit/GME-297

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Nov 22 17:09:19 CST 2010


Author: ksmyth
Date: Mon Nov 22 17:09:19 2010
New Revision: 1091

Log:
Test for moving folder into folder (which didn't work previously)

Added:
   trunk/Tests/GPyUnit/GME-297/test5-correct.mga   (contents, props changed)
   trunk/Tests/GPyUnit/GME-297/test5-output.mga   (contents, props changed)
   trunk/Tests/GPyUnit/GME-297/test5.mga   (contents, props changed)
Modified:
   trunk/Tests/GPyUnit/GME-297/test.py

Modified: trunk/Tests/GPyUnit/GME-297/test.py
==============================================================================
--- trunk/Tests/GPyUnit/GME-297/test.py	Mon Nov 22 16:37:50 2010	(r1090)
+++ trunk/Tests/GPyUnit/GME-297/test.py	Mon Nov 22 17:09:19 2010	(r1091)
@@ -29,11 +29,19 @@
         self.project.Open("MGA=" + self.input_file)
         self.territory = self.project.BeginTransactionInNewTerr()
 
-        modelb = self.project.ObjectByPath(self.fco_to_move)
-        modelb.Name
-        tomove = win32com.client.DispatchEx("Mga.MgaFCOs")
-        tomove.Append(modelb)
-        self.project.ObjectByPath(self.destination_model).MoveFCOs(tomove, None, None)
+        fco_to_move = self.project.ObjectByPath(self.fco_to_move)
+        OBJTYPE_FOLDER = 6
+        if fco_to_move.ObjType == OBJTYPE_FOLDER:
+            tomove = win32com.client.DispatchEx("Mga.MgaFolders")
+        else:
+            tomove = win32com.client.DispatchEx("Mga.MgaFCOs")
+        tomove.Append(fco_to_move)
+
+        destination = self.project.ObjectByPath(self.destination_model)
+        if destination.ObjType == OBJTYPE_FOLDER:
+            destination.MoveFolders(tomove, None)
+        else:
+            destination.MoveFCOs(tomove, None, None)
 
         self.project.CommitTransaction()
         self.project.Save("MGA=" + self.output_file)
@@ -51,6 +59,7 @@
     suite.addTest(TestRefportConnectionInvariantUnderMoves(input_file="test2.mga", fco_to_move="/Test2/Subtypes/A/BSubtypeRef", destination_model="/Test2/Destination/Destination"))
     suite.addTest(TestRefportConnectionInvariantUnderMoves(input_file="test1.mga", fco_to_move="/Test1/Folder1/A/RefB", destination_model="/Test1/Folder2/C", name="test3"))
     suite.addTest(TestRefportConnectionInvariantUnderMoves(input_file="test4.mga", fco_to_move="/Test4/Folder1/A/RefRefB", destination_model="/Test4/Folder2/C"))
+    suite.addTest(TestRefportConnectionInvariantUnderMoves(input_file="test5.mga", fco_to_move="/Test4/Folder2", destination_model="/Test4/Folder3"))
     return suite
 
 if __name__ == "__main__":

Added: trunk/Tests/GPyUnit/GME-297/test5-correct.mga
==============================================================================
Binary file. No diff available.

Added: trunk/Tests/GPyUnit/GME-297/test5-output.mga
==============================================================================
Binary file. No diff available.

Added: trunk/Tests/GPyUnit/GME-297/test5.mga
==============================================================================
Binary file. No diff available.


More information about the gme-commit mailing list