comparison genshi/filters/tests/transform.py @ 801:9fe8fdca279e stable-0.5.x

Ported [1000] to stable branch.
author cmlenz
date Tue, 03 Mar 2009 20:20:09 +0000
parents 614b850faaf6
children
comparison
equal deleted inserted replaced
798:c690de5abafd 801:9fe8fdca279e
520 def test_filter_text_root(self): 520 def test_filter_text_root(self):
521 self.assertEqual( 521 self.assertEqual(
522 self._filter('.', 'foo'), 522 self._filter('.', 'foo'),
523 [[(None, TEXT, u'foo')]]) 523 [[(None, TEXT, u'foo')]])
524 524
525 def test_filter_after_outside(self):
526 stream = _transform(
527 '<root>x</root>', Transformer('//root/text()').filter(lambda x: x))
528 self.assertEqual(
529 list(stream),
530 [(None, START, u'root'),
531 (OUTSIDE, TEXT, u'x'),
532 (None, END, u'root')])
533
525 534
526 class MapTest(unittest.TestCase): 535 class MapTest(unittest.TestCase):
527 def _map(self, select, kind=None): 536 def _map(self, select, kind=None):
528 data = [] 537 data = []
529 def record(d): 538 def record(d):
Copyright (C) 2012-2017 Edgewall Software