示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    def test_match(self):
        re = '.*(fish).*'
        m = Matcher(re, None)

        r = m.match('I am a fish.')
        self.assertTrue(r)