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')) )
def test_text_list(self): root = XpathSelector(self.tree) self.assertEquals( set(['one', 'yet one']), set(root.select('//ul/li[1]').text_list()), )
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]')]), )
def test_text_list(self): root = XpathSelector(self.tree) self.assertEquals(set(['one', 'yet one']), set(root.select('//ul/li[1]').text_list()), )
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]')]), )