Exemplo n.º 1
0
 def test_html(self):
     sel = XpathSelector(self.tree.xpath("//h1")[0])
     self.assertEquals("<h1>test</h1>", sel.html().strip())
Exemplo n.º 2
0
 def test_html(self):
     sel = XpathSelector(self.tree).select("//ul/li")
     self.assertEquals(u"<li>one</li>", sel.html().strip())
Exemplo n.º 3
0
 def test_html_default(self):
     sel = XpathSelector(self.tree).select("//ul/li[10]")
     self.assertRaises(DataNotFound, sel.html)
     self.assertEquals("DEFAULT", sel.html(default="DEFAULT"))
Exemplo n.º 4
0
 def test_html(self):
     sel = XpathSelector(self.tree.xpath('//h1')[0])
     self.assertEquals('<h1>test</h1>', sel.html().strip())
Exemplo n.º 5
0
 def test_text_selector_html(self):
     sel = XpathSelector(self.tree).select("//li/text()").one()
     self.assertEquals(u"one", sel.html())
Exemplo n.º 6
0
 def test_html(self):
     sel = XpathSelector(self.tree).select('//ul/li')
     self.assertEquals(u'<li>one</li>', sel.html().strip())
Exemplo n.º 7
0
 def test_html_default(self):
     sel = XpathSelector(self.tree).select('//ul/li[10]')
     self.assertRaises(DataNotFound, sel.html)
     self.assertEquals('DEFAULT', sel.html(default='DEFAULT'))
Exemplo n.º 8
0
 def test_text_selector_html(self):
     sel = XpathSelector(self.tree).select('//li/text()').one()
     self.assertEquals(u'one', sel.html())
Exemplo n.º 9
0
 def test_html(self):
     sel = XpathSelector(self.tree.xpath('//h1')[0])
     self.assertEquals('<h1>test</h1>', sel.html().strip())
Exemplo n.º 10
0
 def test_html_default(self):
     sel = XpathSelector(self.tree).select('//ul/li[10]')
     self.assertRaises(DataNotFound, sel.html)
     self.assertEquals('DEFAULT', sel.html(default='DEFAULT'))
Exemplo n.º 11
0
 def test_html(self):
     sel = XpathSelector(self.tree).select('//ul/li')
     self.assertEquals(u'<li>one</li>', sel.html().strip())
Exemplo n.º 12
0
 def test_text_selector_html(self):
     sel = XpathSelector(self.tree).select('//li/text()').one()
     self.assertEquals(u'one', sel.html())