def test_versionAllData(self):
   """ Test for versioning mock data tree """
   msg = "Testing versionData..."
   print("\n", msg)
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id)
   applicationChildren = self.communicator.folder_children(self.token, self.ApplicationFolder["folder_id"])
   index = midasdata._getFolderIndex(applicationChildren, self.destVersion)
   self.assertTrue(index > -1)
   destID = midasdata._getIDfromIndex(applicationChildren, "folder", index)
   self.assertTrue(midasdata.itemExists(destID, "item_Application", self.token, self.communicator))
   self.cleanUpFolder()
   print(msg + "[DONE]")
コード例 #2
0
ファイル: midasdata_test.py プロジェクト: 8stand/Slicer
 def test_versionAllData(self):
   """ Test for versioning mock data tree """
   msg = "Testing versionData..."
   print "\n", msg
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id)
   applicationChildren = self.communicator.folder_children(self.token, self.ApplicationFolder["folder_id"])
   index = midasdata._getFolderIndex(applicationChildren, self.destVersion)
   self.assertTrue(index > -1)
   destID = midasdata._getIDfromIndex(applicationChildren, "folder", index)
   self.assertTrue(midasdata.itemExists(destID, "item_Application", self.token, self.communicator))
   self.cleanUpFolder()
   print msg + "[DONE]"
 def test_versionAllData_ignoreModules(self):
   """ Test for ignoring modules while versioning """
   msg = "Testing versionData ignoring modules..."
   print("\n", msg)
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id, ["Module2"], False, False)
   modulesChildren = self.communicator.folder_children(self.token, self.ModulesFolder["folder_id"])
   index = midasdata._getFolderIndex(modulesChildren, "Module2")
   self.assertTrue(index > -1)
   module2ID = midasdata._getIDfromIndex(modulesChildren, "folder", index)
   module2Children = self.communicator.folder_children(self.token, module2ID)
   self.assertTrue(len(module2Children["folders"]) == 1)
   self.cleanUpFolder()
   print(msg + "[DONE]")
コード例 #4
0
ファイル: midasdata_test.py プロジェクト: 8stand/Slicer
 def test_versionAllData_ignoreModules(self):
   """ Test for ignoring modules while versioning """
   msg = "Testing versionData ignoring modules..."
   print "\n", msg
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id, ["Module2"], False, False)
   modulesChildren = self.communicator.folder_children(self.token, self.ModulesFolder["folder_id"])
   index = midasdata._getFolderIndex(modulesChildren, "Module2")
   self.assertTrue(index > -1)
   module2ID = midasdata._getIDfromIndex(modulesChildren, "folder", index)
   module2Children = self.communicator.folder_children(self.token, module2ID)
   self.assertTrue(len(module2Children["folders"]) == 1)
   self.cleanUpFolder()
   print msg + "[DONE]"
 def test_versionAllData_overwrite(self):
   """ Test for overwriting items while versioning """
   msg = "Testing versionData with overwrite..."
   print("\n", msg)
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id)
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id, [], True, False)
   applicationChildren = self.communicator.folder_children(self.token, self.ApplicationFolder["folder_id"])
   index = midasdata._getFolderIndex(applicationChildren, self.destVersion)
   self.assertTrue(index > -1)
   destID = midasdata._getIDfromIndex(applicationChildren, "folder", index)
   dest_items = self.communicator.folder_children(self.token, destID)
   self.assertEqual(len(dest_items["items"]), 1)
   self.cleanUpFolder()
   print(msg + "[DONE]")
コード例 #6
0
ファイル: midasdata_test.py プロジェクト: 8stand/Slicer
 def test_versionAllData_overwrite(self):
   """ Test for overwriting items while versioning """
   msg = "Testing versionData with overwrite..."
   print "\n", msg
   self.createFolderStructure()
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id)
   midasdata.versionData(self.url, self.cur_email, self.cur_apikey, self.sourceVersion, self.destVersion, self.data_id, [], True, False)
   applicationChildren = self.communicator.folder_children(self.token, self.ApplicationFolder["folder_id"])
   index = midasdata._getFolderIndex(applicationChildren, self.destVersion)
   self.assertTrue(index > -1)
   destID = midasdata._getIDfromIndex(applicationChildren, "folder", index)
   dest_items = self.communicator.folder_children(self.token, destID)
   self.assertTrue(len(dest_items["items"]) == 1)
   self.cleanUpFolder()
   print msg + "[DONE]"