示例#1
0
 def test_get_page_text_with_text(self):
     doc = ET.fromstring('<head>text<sub>subtext</sub></head>')
     page = SimulatedPage(doc)
     self.assertEqual(list(utils.get_page_text(page)), ['text', 'subtext'])
示例#2
0
 def test_get_page_text_with_text(self):
     page = SimulatedPage()
     doc = ET.fromstring('<head>text<sub>subtext</sub></head>')
     page.document = doc
     self.assertEqual(list(utils.get_page_text(page)),
                      ['text', 'subtext'])
示例#3
0
 def test_get_page_text_no_text(self):
     doc = ET.fromstring('<head><sub></sub></head>')
     page = SimulatedPage(doc)
     self.assertEqual(list(utils.get_page_text(page)), [])
示例#4
0
 def test_get_page_text_no_text(self):
     page = SimulatedPage()
     doc = ET.fromstring('<head><sub></sub></head>')
     page.document = doc
     self.assertEqual(list(utils.get_page_text(page)), [])