Ejemplo n.º 1
0
 def test_get_re_with_head_slash(self, _fnmatch):
     result = get_re_from_single_line("./too_young.py")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("too_young.py")
Ejemplo n.º 2
0
 def test_get_re_with_double_asterisk(self, _fnmatch):
     result = get_re_from_single_line("young/**/simple/**/naive")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("young/*/simple/*/naive")
Ejemplo n.º 3
0
 def test_get_re_with_space(self, _fnmatch):
     result = get_re_from_single_line("too\\ young.py")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("too young.py")
Ejemplo n.º 4
0
 def test_get_re_from_simple_line(self, _fnmatch):
     result = get_re_from_single_line("excited/")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("excited/*")
Ejemplo n.º 5
0
 def test_get_re_with_negate_pattern(self, _fnmatch):
     result = get_re_from_single_line("!too_simple.py")
     self.assertEqual(result[0], 2)
     _fnmatch.translate.assert_called_once_with("too_simple.py")
Ejemplo n.º 6
0
 def test_get_re_from_comment_line(self, _fnmatch):
     result = get_re_from_single_line("# too simple")
     self.assertEqual(result, (0, None))
     self.assertEqual(_fnmatch.translate.call_count, 0)
Ejemplo n.º 7
0
 def test_get_re_from_hash_line(self, _fnmatch):
     result = get_re_from_single_line("\\#2A00BF")
     self.assertEqual(result, (1, "2A00BF"))
     self.assertEqual(_fnmatch.translate.call_count, 0)
Ejemplo n.º 8
0
 def test_get_re_with_head_slash(self, _fnmatch):
     result = get_re_from_single_line("./too_young.py")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("too_young.py")
Ejemplo n.º 9
0
 def test_get_re_from_blank_line(self, _fnmatch):
     result = get_re_from_single_line(" ")
     self.assertEqual(result, (0, None))
     self.assertEqual(_fnmatch.translate.call_count, 0)
Ejemplo n.º 10
0
 def test_get_re_with_double_asterisk(self, _fnmatch):
     result = get_re_from_single_line("young/**/simple/**/naive")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("young/*/simple/*/naive")
Ejemplo n.º 11
0
 def test_get_re_with_space(self, _fnmatch):
     result = get_re_from_single_line("too\\ young.py")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("too young.py")
Ejemplo n.º 12
0
 def test_get_re_with_negate_pattern(self, _fnmatch):
     result = get_re_from_single_line("!too_simple.py")
     self.assertEqual(result[0], 2)
     _fnmatch.translate.assert_called_once_with("too_simple.py")
Ejemplo n.º 13
0
 def test_get_re_from_simple_line(self, _fnmatch):
     result = get_re_from_single_line("excited/")
     self.assertEqual(result[0], 3)
     _fnmatch.translate.assert_called_once_with("excited/*")
Ejemplo n.º 14
0
 def test_get_re_from_hash_line(self, _fnmatch):
     result = get_re_from_single_line("\\#2A00BF")
     self.assertEqual(result, (1, "2A00BF"))
     self.assertEqual(_fnmatch.translate.call_count, 0)
Ejemplo n.º 15
0
 def test_get_re_from_comment_line(self, _fnmatch):
     result = get_re_from_single_line("# too simple")
     self.assertEqual(result, (0, None))
     self.assertEqual(_fnmatch.translate.call_count, 0)
Ejemplo n.º 16
0
 def test_get_re_from_blank_line(self, _fnmatch):
     result = get_re_from_single_line(" ")
     self.assertEqual(result, (0, None))
     self.assertEqual(_fnmatch.translate.call_count, 0)