2 # -*- coding: utf-8 -*-
3 # This test executes the coupling.xml schema found in the current directory
4 # and verifies the execution state.
12 sys.path[:0] = [os.path.join(appli_dir, "bin", "salome", "appliskel")]
13 salome_module = imp.load_source("SALOME", os.path.join(appli_dir, "salome"))
15 class TestCompo(unittest.TestCase):
17 #start salome and connect to it
19 salome_module.main(["start", "-t"])
20 except SystemExit as e:
23 runSession.configureSession()
27 # creat study and load catalogs
29 SALOMERuntime.RuntimeSALOME_setRuntime()
30 salome_runtime = SALOMERuntime.getSALOMERuntime()
35 mc = salome.naming_service.Resolve('/Kernel/ModulCatalog')
36 ior = salome.orb.object_to_string(mc)
37 session_catalog = salome_runtime.loadCatalog("session", ior)
38 salome_runtime.addCatalog(session_catalog)
40 def test_exec_scheme(self):
44 xmlLoader = loader.YACSLoader()
46 p = xmlLoader.load("coupling.xml")
48 self.fail("IO exception:" + ex);
49 self.assertTrue(p.isValid())
50 e = pilot.ExecutorSwig()
52 self.assertEqual(p.getEffectiveState(), pilot.DONE)
56 salome_module.main(["killall"])
57 except SystemExit as e:
60 if __name__ == '__main__':