def test_globset_and_plain(self): gs = devices.GlobSet('ab') self.assertTrue(gs & set('a')) self.assertTrue(gs & set('b')) self.assertTrue(gs & set('ab')) self.assertTrue(gs & set('bc')) self.assertFalse(gs & set('cd'))
def test_globset_both_match(self): gs = devices.GlobSet(['a', 'b*']) self.assertTrue('a' in gs) self.assertTrue('b' in gs) self.assertTrue('ba' in gs) self.assertFalse('ab' in gs) self.assertFalse('c' in gs)
def test_globset_and(self): gs = devices.GlobSet(['a', 'b*']) self.assertTrue(gs & set('a')) self.assertTrue(gs & set('b')) self.assertTrue(gs & set('bc')) self.assertTrue(gs & set(['bc', 'c'])) self.assertFalse(gs & set('cd'))
def test_globset_regular_match(self): gs = devices.GlobSet('abc') self.assertTrue('a' in gs) self.assertTrue('A' in gs) self.assertTrue('b' in gs) self.assertTrue('c' in gs) self.assertFalse('d' in gs) self.assertFalse('aa' in gs)