def test_should_find_all_anchors_in_markup(self): html = """<div id="content"> <a href="#">Link 1</a> <a href="#">Link 2</a> </div>""" markup = parse(html) page = Page(markup, None) anchors = page.find_links_in_content(markup) self.assertEqual(len(anchors), 2)
def test_should_not_find_anchors_outside_of_the_content_container(self): html = """<div id="content"> <a href="#">Link 1</a> </div> <a href="#">Link 2</a>""" markup = parse(html) page = Page(markup, None) anchors = page.find_links_in_content(markup) self.assertEqual(len(anchors), 1)