Exemplo n.º 1
0
 def test_attr_list(self):
     root = JsonSelector(self.tree)
     self.assertRaises(
         NotImplementedError,
         lambda: root.select('$..population').attr_list('bar'))
Exemplo n.º 2
0
 def test_text_list(self):
     root = JsonSelector(self.tree)
     self.assertEquals(['7000000000', '0'],
                       root.select('$..population').text_list())
Exemplo n.º 3
0
 def test_html(self):
     root = JsonSelector(self.tree)
     self.assertRaises(NotImplementedError,
                       lambda: root.select('$..population')[0].html())
Exemplo n.º 4
0
 def test_select_select(self):
     root = JsonSelector(self.tree)
     self.assertEquals('Mars', root.select('$[1]').select('name').text())
Exemplo n.º 5
0
 def test_attr_list(self):
     root = JsonSelector(self.tree)
     self.assertRaises(NotImplementedError,
         lambda: root.select('$..population').attr_list('bar'))
Exemplo n.º 6
0
 def test_html(self):
     root = JsonSelector(self.tree)
     self.assertRaises(NotImplementedError,
         lambda: root.select('$..population')[0].html())
Exemplo n.º 7
0
 def test_text_list(self):
     root = JsonSelector(self.tree)
     self.assertEquals(['7000000000', '0'],
                       root.select('$..population').text_list())
Exemplo n.º 8
0
 def test_select_select(self):
     root = JsonSelector(self.tree)
     self.assertEquals('Mars', root.select('$[1]').select('name').text())