Esempio n. 1
0
 def test_attr_list(self):
     root = XpathSelector(self.tree)
     self.assertEquals(set(['li-1', 'li-2']),
                       set(root.select('//ul[@id="second-list"]/li')\
                               .attr_list('class'))
                       )
Esempio n. 2
0
 def test_text_list(self):
     root = XpathSelector(self.tree)
     self.assertEquals(
         set(['one', 'yet one']),
         set(root.select('//ul/li[1]').text_list()),
     )
Esempio n. 3
0
 def test_select_select(self):
     root = XpathSelector(self.tree)
     self.assertEquals(
         set(['one', 'yet one']),
         set([x.text() for x in root.select('//ul').select('./li[1]')]),
     )
Esempio n. 4
0
 def test_attr_list(self):
     root = XpathSelector(self.tree)
     self.assertEquals(set(['li-1', 'li-2']),
                       set(root.select('//ul[@id="second-list"]/li')\
                               .attr_list('class'))
                       )
Esempio n. 5
0
 def test_text_list(self):
     root = XpathSelector(self.tree)
     self.assertEquals(set(['one', 'yet one']),
                       set(root.select('//ul/li[1]').text_list()),
                       )
Esempio n. 6
0
 def test_select_select(self):
     root = XpathSelector(self.tree)
     self.assertEquals(set(['one', 'yet one']),
                       set([x.text() for x in root.select('//ul').select('./li[1]')]),
                       )