Add tagre test.

This commit is contained in:
Bastian Kleineidam 2012-10-11 21:32:42 +02:00
parent 9c4f7b086f
commit 6fbf2e5cc8

View file

@ -68,10 +68,11 @@ class RegexTest(TestCase):
('<Img src="%s">', ValuePrefix, True),
('<img SrC="%s">', ValuePrefix, True),
('<img src="%s">', ValuePrefix[:-1], False),
('<img class="prev" src="%s" a="b">', ValuePrefix, True),
)
def test_regex(self):
matcher = re.compile(tagre("img", "src", "(%s.*)" % self.ValuePrefix))
matcher = re.compile(tagre("img", "src", '(%s[^"]*)' % self.ValuePrefix))
for tag, value, domatch in self.TagTests:
self.match_tag(matcher, tag, value, domatch)