Mercurial > genshi > mirror
comparison markup/tests/template.py @ 145:47bbd9d2a5af trunk
* Fix error in expression evaluation when the expression evaluates to an iterable that does not produce event tuples.
* The first location step in path expressions longer assumes the `descendant::` axis, but rather the `child::` axis.
* Import cleanups.
author | cmlenz |
---|---|
date | Tue, 15 Aug 2006 09:52:47 +0000 |
parents | d681d2c3cd8d |
children | 537f819c547b |
comparison
equal
deleted
inserted
replaced
144:d1ce85a7f296 | 145:47bbd9d2a5af |
---|---|
494 | 494 |
495 def test_interpolate_non_string_attrs(self): | 495 def test_interpolate_non_string_attrs(self): |
496 tmpl = Template('<root attr="${1}"/>') | 496 tmpl = Template('<root attr="${1}"/>') |
497 self.assertEqual('<root attr="1"/>', str(tmpl.generate())) | 497 self.assertEqual('<root attr="1"/>', str(tmpl.generate())) |
498 | 498 |
499 def test_interpolate_list_result(self): | |
500 tmpl = Template('<root>$foo</root>') | |
501 ctxt = Context(foo=('buzz',)) | |
502 self.assertEqual('<root>buzz</root>', str(tmpl.generate(ctxt))) | |
503 | |
499 def test_empty_attr(self): | 504 def test_empty_attr(self): |
500 tmpl = Template('<root attr=""/>') | 505 tmpl = Template('<root attr=""/>') |
501 self.assertEqual('<root attr=""/>', str(tmpl.generate())) | 506 self.assertEqual('<root attr=""/>', str(tmpl.generate())) |
502 | 507 |
503 def test_bad_directive_error(self): | 508 def test_bad_directive_error(self): |