def test_xlist_wildcard_match_nomatches(self): xl = XList(['MANY', 'many', 'Many'], {'first_attr': 1}) nl = xl.wildcard_match('t*') self.assertTrue(len(nl) == 0)
def test_xlist_wildcard_match(self): xl = XList(['MANY', 'many', 'Many'], {'first_attr': 1}) nl = xl.wildcard_match('m*') self.assertTrue(len(nl) == 1) self.assertEqual(nl[0], 'many')
def test_xlist_wildcard_match_nonstring(self): xl = XList(['MANY', 1, 'many'], {'first_attr': 1}) with self.assertRaises(TypeError): nl = xl.wildcard_match( 'm*' ) # when the list contains non-string types, TypeError is raised
def test_xlist_wildcard_match_nonstring(self): xl = XList(['MANY', 1, 'many'], {'first_attr': 1}) with self.assertRaises(TypeError): nl = xl.wildcard_match('m*') # when the list contains non-string types, TypeError is raised