class TestFilenameMatches(unittest.TestCase):
    def setUp(self):
        self.rule = FilenameMatches('^ex\d\d\d\d')

    def test_regex_match(self):
        # Regex is case sensitive
        self.assertTrue(self.rule.test('ex20140801.log'))
        self.assertFalse(self.rule.test('EX20140801.log'))

    def test_regex_doesnt_match(self):
        self.assertFalse(self.rule.test('tta3.log'))
Example #2
0
class TestFilenameMatches(unittest.TestCase):
    def setUp(self):
        self.rule = FilenameMatches('^ex\d\d\d\d')

    def test_regex_match(self):
        # Regex is case sensitive
        self.assertTrue(self.rule.test('ex20140801.log'))
        self.assertFalse(self.rule.test('EX20140801.log'))

    def test_regex_doesnt_match(self):
        self.assertFalse(self.rule.test('tta3.log'))
 def setUp(self):
     self.rule = FilenameMatches('^ex\d\d\d\d')
Example #4
0
 def setUp(self):
     self.rule = FilenameMatches('^ex\d\d\d\d')