示例#1
0
 def test_finds_hrefs_inside_otherstuff(self):
     self.assertEquals(
         get_anchor_contents('Here is a <a href="http://example.com/?blah=1234&something-else=KKdjfkdksa">link</a> to somewhere...'),
         [u'link']
     )
示例#2
0
 def test_finds_two_duplicates(self):
     self.assertEquals(
         get_anchor_contents('<a href="http://example.com">Test</a><a href="http://example.com">Test</a>'),
         [u'Test', u'Test']
     )
示例#3
0
 def test_finds_single_href(self):
     self.assertEquals(
         get_anchor_contents('<a href="http://example.com">Test</a>'),
         [u'Test']
     )
示例#4
0
 def test_finds_hrefs_inside_otherstuff(self):
     self.assertEquals(
         get_anchor_contents(
             'Here is a <a href="http://example.com/?blah=1234&something-else=KKdjfkdksa">link</a> to somewhere...'
         ), [u'link'])
示例#5
0
 def test_finds_two_duplicates(self):
     self.assertEquals(
         get_anchor_contents(
             '<a href="http://example.com">Test</a><a href="http://example.com">Test</a>'
         ), [u'Test', u'Test'])
示例#6
0
 def test_finds_single_href(self):
     self.assertEquals(
         get_anchor_contents('<a href="http://example.com">Test</a>'),
         [u'Test'])