class TestDefaultMatcher(unittest.TestCase): def setUp(self): self.matcher = DefaultMatcher() def test_matches_catch_all(self): self.assertTrue( self.matcher.matches(CATCH_ALL_PATTERN, "line"), "Catch all does not match line") def test_does_not_match_unmatchable(self): self.assertFalse( self.matcher.matches(CATCH_NOTHING_PATTERN, "line"), "Unmatchable pattern matches line") def test_matches_in_the_middle_of_the_string(self): self.assertTrue( self.matcher.matches(MIDDLE_STRING_PATTERN, "line"), "Does not match in the middle of the string")
def setUp(self): self.matcher = DefaultMatcher()