Esempio n. 1
0
    def test_glob(self):
        self.assertIs(match('foo', 'glob:f*'), True)
        self.assertIs(match('foo', 'glob:fo?'), True)
        self.assertIs(match('foo', 'glob:'), False)

        self.assertIs(match('foo', 'glob:b*'), False)
        self.assertIs(match('foo', 'glob:?ar'), False)
Esempio n. 2
0
 def test_multiline_strings(self):
     self.assertIs(match('foo\nbar', 'glob:foo*'), True)
     self.assertIs(match('foo\nbar', 'regex:^foo.*$'), True)
Esempio n. 3
0
 def test_regexp(self):
     self.assertIs(match('foo', 'regexp:^fo+$'), True)
     self.assertIs(match('foo', 'regexp:^f+$'), False)
Esempio n. 4
0
 def test_glob_with_regex_chars_should_work(self):
     self.assertIs(match('(foo)', 'glob:(foo)'), True)
     self.assertIs(match('[foo]', 'glob:[foo]'), True)
Esempio n. 5
0
 def test_exact(self):
     self.assertIs(match('foo', 'exact:foo'), True)
     self.assertIs(match('foo', 'exact:bar'), False)
Esempio n. 6
0
 def test_no_prefix(self):
     self.assertIs(match('foo', 'foo'), True)
     self.assertIs(match('foo', 'bar'), False)
     self.assertIs(match('foo:bar', 'foo:bar'), True)