comparison genshi/tests/path.py @ 834:fbcb799ee03b

Added XPath unit test for #234.
author cmlenz
date Tue, 17 Mar 2009 14:35:12 +0000
parents b5c9b92b0bd6
children 155c499496fe
comparison
equal deleted inserted replaced
833:b5c9b92b0bd6 834:fbcb799ee03b
210 </table>''') 210 </table>''')
211 self._test_eval( 211 self._test_eval(
212 path = 'tr/td[1]', 212 path = 'tr/td[1]',
213 input = xml, 213 input = xml,
214 output = '<td>1</td><td>2</td>' 214 output = '<td>1</td><td>2</td>'
215 )
216 xml = XML('''('<ul>
217 <li>item1
218 <ul><li>subitem11</li></ul>
219 </li>
220 <li>item2
221 <ul><li>subitem21</li></ul>
222 </li>
223 </ul>''')
224 self._test_eval(
225 path = 'li[2]/ul',
226 input = xml,
227 output = '<ul><li>subitem21</li></ul>'
215 ) 228 )
216 229
217 def test_2step_text(self): 230 def test_2step_text(self):
218 xml = XML('<root><item>Foo</item></root>') 231 xml = XML('<root><item>Foo</item></root>')
219 self._test_eval( 232 self._test_eval(
Copyright (C) 2012-2017 Edgewall Software