Beispiel #1
0
 def test_match_variable_with_path_fail(self):
     self.assertFalse(filematch.match_key(
         'images/*.png', 'images/README', regexp=False))
Beispiel #2
0
 def test_match_base_fail_different_path(self):
     self.assertFalse(filematch.match_key(
         'ok.html', 'dir/book.html', regexp=False))
Beispiel #3
0
 def test_match_variable_base_within_ok(self):
     self.assertTrue(filematch.match_key(
         'image-*.png', 'image-999.png', regexp=False))
Beispiel #4
0
 def test_match_exact_with_path_ok(self):
     self.assertTrue(filematch.match_key(
         '/dir/index.html', 'dir/index.html', regexp=False))
Beispiel #5
0
 def test_match_base_ok_simple(self):
     self.assertTrue(filematch.match_key(
         'index.html', 'index.html', regexp=False))
Beispiel #6
0
 def test_match_regex_dollar_suffix_ok(self):
     self.assertTrue(filematch.match_key(
         r'image-\d+\.png$', 'image-999.png', regexp=True))
Beispiel #7
0
 def test_match_base_fail_different_name(self):
     self.assertFalse(filematch.match_key('ok.html', 'book.html'))
 def test_match_base_ok_simple(self):
     self.assertTrue(filematch.match_key('index.html', 'index.html'))
 def test_match_base_ok_path(self):
     self.assertTrue(filematch.match_key('index.html', 'dir/index.html'))
 def test_match_exact_with_path_ok(self):
     self.assertTrue(filematch.match_key(
         '/dir/index.html', 'dir/index.html'))
 def test_match_exact_with_path_fail_different_path(self):
     self.assertFalse(filematch.match_key(
         '/dir/index.html', 'altdir/image.png'))
 def test_match_exact_fail_different_path(self):
     self.assertFalse(filematch.match_key('/index.html', 'dir/index.html'))
 def test_match_exact_fail_different_name(self):
     self.assertFalse(filematch.match_key('/index.html', 'image.png'))
Beispiel #14
0
 def test_match_empty_on_file(self):
     with self.assertRaises(ValueError):
         filematch.match_key('', 'index.html')
Beispiel #15
0
 def test_match_one_ok(self):
     self.assertTrue(filematch.match_key(
         'image?.png', 'image1.png', regexp=False))
 def test_match_base_fail_different_path(self):
     self.assertFalse(filematch.match_key('ok.html', 'dir/book.html'))
Beispiel #17
0
 def test_match_one_fail(self):
     self.assertFalse(filematch.match_key(
         'image?.png', 'image10.png', regexp=False))
 def test_match_variable_base_ok(self):
     self.assertTrue(filematch.match_key('*.html', 'index.html'))
Beispiel #19
0
 def test_match_regex_caret_prefix_fail(self):
     self.assertFalse(filematch.match_key(
         r'^dir\/index\.html', 'altdir/index.html', regexp=True))
 def test_match_variable_base_within_ok(self):
     self.assertTrue(filematch.match_key('image-*.png', 'image-999.png'))
Beispiel #21
0
 def test_match_exact_fail_different_path(self):
     self.assertFalse(filematch.match_key(
         '/index.html', 'dir/index.html', regexp=False))
 def test_match_variable_with_path_ok(self):
     self.assertTrue(filematch.match_key('images/*.png', 'images/999.png'))
Beispiel #23
0
 def test_match_exact_with_path_fail_different_path(self):
     self.assertFalse(filematch.match_key(
         '/dir/index.html', 'altdir/image.png', regexp=False))
 def test_match_variable_with_path_fail(self):
     self.assertFalse(filematch.match_key('images/*.png', 'images/README'))
Beispiel #25
0
 def test_match_base_ok_path(self):
     self.assertTrue(filematch.match_key(
         'index.html', 'dir/index.html', regexp=False))
 def test_match_multilevel_fail(self):
     self.assertFalse(filematch.match_key(
         '/dir/*.html', 'dir/second/file.html'))
Beispiel #27
0
 def test_match_variable_base_ok(self):
     self.assertTrue(filematch.match_key(
         '*.html', 'index.html', regexp=False))
 def test_match_one_ok(self):
     self.assertTrue(filematch.match_key('image?.png', 'image1.png'))
Beispiel #29
0
 def test_match_variable_with_path_ok(self):
     self.assertTrue(filematch.match_key(
         'images/*.png', 'images/999.png', regexp=False))
 def test_match_one_fail(self):
     self.assertFalse(filematch.match_key('image?.png', 'image10.png'))
Beispiel #31
0
 def test_match_multilevel_fail(self):
     self.assertFalse(filematch.match_key(
         '/dir/*.html', 'dir/second/file.html', regexp=False))
 def test_match_empty_on_file(self):
     with self.assertRaises(ValueError):
         filematch.match_key('', 'index.html')
Beispiel #33
0
 def test_match_exact_ok(self):
     self.assertTrue(filematch.match_key(
         '/index.html', 'index.html', regexp=False))
 def test_match_empty_on_empty(self):
     with self.assertRaises(ValueError):
         filematch.match_key('', '')
Beispiel #35
0
 def test_match_empty_on_empty(self):
     with self.assertRaises(ValueError):
         filematch.match_key('', '', regexp=False)
 def test_match_exact_ok(self):
     self.assertTrue(filematch.match_key('/index.html', 'index.html'))
Beispiel #37
0
 def test_match_regex_dollar_suffix_fail(self):
     self.assertFalse(filematch.match_key(
         r'image-\d+\.png$', 'image-name.png', regexp=True))
Beispiel #38
0
 def test_match_exact_fail_different_name(self):
     self.assertFalse(filematch.match_key(
         '/index.html', 'image.png', regexp=False))
Beispiel #39
0
 def test_match_regex_caret_and_dollar_ok(self):
     self.assertTrue(filematch.match_key(
         r'^dir\/index\.html$', 'dir/index.html', regexp=True))
Beispiel #40
0
 def test_match_exact_with_path_fail_different_name(self):
     self.assertFalse(
         filematch.match_key('/dir/index.html', 'dir/image.png'))