def test_miss(self): 'Test when they do not match' re = '.*(fish).*' m = Matcher(re, None) r = m.match('I am a dog.') self.assertFalse(r)
def test_sub(self): re = 'fish' sub = 'dog' m = Matcher(re, sub) r = m.sub('I am a fish.') self.assertEqual('I am a dog.', r)
def test_match(self): re = '.*(fish).*' m = Matcher(re, None) r = m.match('I am a fish.') self.assertTrue(r)