def test_select_where_after_relate(self): s_edt = self.m.new('S_EDT') s_dt = self.m.new('S_DT') pe_pe = self.m.new('PE_PE') self.assertFalse(self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID))) self.assertTrue(xtuml.relate(s_dt, pe_pe, 8001)) self.assertTrue(xtuml.relate(s_dt, s_edt, 17)) self.assertTrue(self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID))) self.assertTrue(xtuml.unrelate(s_dt, pe_pe, 8001)) self.assertTrue(xtuml.unrelate(s_dt, s_edt, 17)) self.assertFalse(self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID)))
def test_filename_input(self): resources = os.path.dirname(__file__) + os.sep + '..' + os.sep + 'resources' schema = resources + os.sep + 'ooaofooa_schema.sql' globs = resources + os.sep + 'Globals.xtuml' metamodel = xtuml.load_metamodel([globs, schema]) self.assertTrue(metamodel.select_any('S_DT', xtuml.where_eq(Name='integer')) is not None)
def test_folder_input(self): dirname = os.path.dirname( __file__) + os.sep + '..' + os.sep + 'resources' metamodel = ooaofooa.load_metamodel(dirname, load_globals=False) self.assertTrue( metamodel.select_any('S_DT', xtuml.where_eq( Name='integer')) is not None)
def test_select_where_after_relate(self): s_edt = self.m.new('S_EDT') s_dt = self.m.new('S_DT') pe_pe = self.m.new('PE_PE') self.assertFalse( self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID))) self.assertTrue(xtuml.relate(s_dt, pe_pe, 8001)) self.assertTrue(xtuml.relate(s_dt, s_edt, 17)) self.assertTrue( self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID))) self.assertTrue(xtuml.unrelate(s_dt, pe_pe, 8001)) self.assertTrue(xtuml.unrelate(s_dt, s_edt, 17)) self.assertFalse( self.m.select_any('S_DT', xtuml.where_eq(DT_ID=pe_pe.Element_ID)))
def test_zipfile_input(self): dirname = os.path.dirname( __file__) + os.sep + '..' + os.sep + 'resources' zipfile = shutil.make_archive(dirname, 'zip', dirname) atexit.register(os.remove, zipfile) metamodel = ooaofooa.load_metamodel(zipfile, load_globals=False) self.assertTrue( metamodel.select_any('S_DT', xtuml.where_eq( Name='integer')) is not None)
def test_filename_input(self): resources = os.path.dirname( __file__) + os.sep + '..' + os.sep + 'resources' schema = resources + os.sep + 'ooaofooa_schema.sql' globs = resources + os.sep + 'Globals.xtuml' metamodel = xtuml.load_metamodel([globs, schema]) self.assertTrue( metamodel.select_any('S_DT', xtuml.where_eq( Name='integer')) is not None)
def test_relate_bottom_up(self): s_dt = self.m.select_one('S_DT', xtuml.where_eq(Name='string')) s_bparm = self.m.new('S_BPARM', Name='My_Parameter') s_ee = self.m.new('S_EE', Name='My_External_Entity', Key_Lett='My_External_Entity') pe_pe = self.m.new('PE_PE', Visibility=True, type=5) s_brg = self.m.new('S_BRG', Name='My_Bridge_Operation') self.assertTrue(xtuml.relate(s_bparm, s_dt, 22)) self.assertTrue(xtuml.relate(s_bparm, s_brg, 21)) self.assertTrue(xtuml.relate(s_brg, s_dt, 20)) self.assertTrue(xtuml.relate(s_ee, pe_pe, 8001)) self.assertTrue(xtuml.relate(s_brg, s_ee, 19)) inst = xtuml.navigate_any(pe_pe).S_EE[8001].S_BRG[19].S_BPARM[21]() self.assertEqual(inst, s_bparm)