Пример #1
0
 def test_no_match_sequence_not_at_end(self):
     """Test REGEX_FILE_COUNTER no match: sequence must be before extention"""
     test_str = "hello_3.x_x.txt"
     matches = REGEX_FILE_COUNTER.findall(test_str)
     self.assertFalse(matches)
Пример #2
0
 def test_sequence_underscore_ext(self):
     """ Test REGEX_FILE_COUNTER extention with underscore"""
     test_str = "hello_3._txt"
     matches = REGEX_FILE_COUNTER.findall(test_str)
     self.assertEqual(len(matches), 1)
     self.assertEqual(matches, ['3',])
Пример #3
0
 def test_sequence_numeric_ext_with_underscore(self):
     """ Test REGEX_FILE_COUNTER numeric extention with underscore"""
     test_str = "hello_3._123"
     matches = REGEX_FILE_COUNTER.findall(test_str)
     self.assertEqual(len(matches), 1)
     self.assertEqual(matches, ['3',])
Пример #4
0
 def test_sequence_repeated(self):
     """ Test REGEX_FILE_COUNTER repeated in sequence"""
     test_str = "hello_1._3.txt"
     matches = REGEX_FILE_COUNTER.findall(test_str)
     self.assertEqual(len(matches), 1)
     self.assertEqual(matches, ['3',])