'tests/resources/paramexp-1.0.2.vt')) vistrail = translateVistrail(save_bundle.vistrail) pes = vistrail.db_get_parameter_explorations() self.assertEqual(len(pes), 1) funs = pes[0].db_functions self.assertEqual(set([f.db_port_name for f in funs]), set(['SetCoefficients', 'SetBackgroundWidget'])) parameters = funs[0].db_parameters self.assertEqual(len(parameters), 10) def testVistrailvars(self): """test translating vistrail variables from 1.0.2 to 1.0.3""" from vistrails.db.services.io import open_bundle_from_zip_xml from vistrails.core.system import vistrails_root_directory import os (save_bundle, vt_save_dir) = open_bundle_from_zip_xml(DBVistrail.vtType, \ os.path.join(vistrails_root_directory(), 'tests/resources/visvar-1.0.2.vt')) vistrail = translateVistrail(save_bundle.vistrail) visvars = vistrail.db_vistrailVariables self.assertEqual(len(visvars), 2) self.assertNotEqual(visvars[0].db_name, visvars[1].db_name) if __name__ == '__main__': from vistrails.gui.application import start_application v = start_application({'interactiveMode': False, 'nologger': True, 'singleInstance': False, 'fixedSpreadsheetCells': True}) unittest.main()
vistrail = translateVistrail(save_bundle.vistrail) pes = vistrail.db_get_parameter_explorations() self.assertEqual(len(pes), 1) funs = pes[0].db_functions self.assertEqual(set([f.db_port_name for f in funs]), set(["SetCoefficients", "SetBackgroundWidget"])) parameters = funs[0].db_parameters self.assertEqual(len(parameters), 10) def testVistrailvars(self): """test translating vistrail variables from 1.0.2 to 1.0.3""" from vistrails.db.services.io import open_bundle_from_zip_xml from vistrails.core.system import vistrails_root_directory import os (save_bundle, vt_save_dir) = open_bundle_from_zip_xml( DBVistrail.vtType, os.path.join(vistrails_root_directory(), "tests/resources/visvar-1.0.2.vt") ) vistrail = translateVistrail(save_bundle.vistrail) visvars = vistrail.db_vistrailVariables self.assertEqual(len(visvars), 2) self.assertNotEqual(visvars[0].db_name, visvars[1].db_name) if __name__ == "__main__": from vistrails.gui.application import start_application v = start_application( {"interactiveMode": False, "nologger": True, "singleInstance": False, "fixedSpreadsheetCells": True} ) unittest.main()
def testParamexp(self): """test translating parameter explorations from 1.0.3 to 1.0.2""" from vistrails.db.services.io import open_bundle_from_zip_xml from vistrails.core.system import vistrails_root_directory import os (save_bundle, vt_save_dir) = open_bundle_from_zip_xml(DBVistrail.vtType, \ os.path.join(vistrails_root_directory(), 'tests/resources/paramexp-1.0.3.vt')) vistrail = translateVistrail(save_bundle.vistrail) # paramexps cannot be downgraded but should produce a warning def testVistrailvars(self): """test translating vistrail variables from 1.0.3 to 1.0.2""" from vistrails.db.services.io import open_bundle_from_zip_xml from vistrails.core.system import vistrails_root_directory import os (save_bundle, vt_save_dir) = open_bundle_from_zip_xml(DBVistrail.vtType, \ os.path.join(vistrails_root_directory(), 'tests/resources/visvar-1.0.3.vt')) vistrail = translateVistrail(save_bundle.vistrail) visvars = vistrail.db_annotations_key_index['__vistrail_vars__'] self.assertTrue(visvars.db_value) if __name__ == '__main__': from vistrails.gui.application import start_application v = start_application({'batch': True, 'nologger': True, 'singleInstance': False, 'fixedSpreadsheetCells': True}) unittest.main()