def test_list_components_wildcard_3(self): cuid = ComponentUID('b:1,*.c') ref = [ str(ComponentUID(self.m.b[1, 1].c)), str(ComponentUID(self.m.b[1, '2'].c)) ] cList = [str(ComponentUID(x)) for x in cuid.list_components(self.m)] self.assertEqual(sorted(cList), sorted(ref))
def test_list_components_wildcard_2(self): cuid = ComponentUID('b:*,*.c.a:*') ref = [ str(ComponentUID(self.m.b[1, '2'].c.a[1])), str(ComponentUID(self.m.b[1, '2'].c.a['2'])), str(ComponentUID(self.m.b[1, '2'].c.a[3])) ] cList = [str(ComponentUID(x)) for x in cuid.list_components(self.m)] self.assertEqual(sorted(cList), sorted(ref))
def test_list_components_scalar(self): cuid = ComponentUID('b:1,$2.c.a:3') ref = [str(ComponentUID(self.m.b[1, '2'].c.a[3]))] cList = [str(ComponentUID(x)) for x in cuid.list_components(self.m)] self.assertEqual(sorted(cList), sorted(ref))
def test_list_components_dne_2(self): cuid = ComponentUID('b:*,*.c:#1.a:*') ref = [] cList = [str(ComponentUID(x)) for x in cuid.list_components(self.m)] self.assertEqual(sorted(cList), sorted(ref))