diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-29 18:28:30 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-29 18:28:30 -0700 |
commit | d94c5e1b64784980a87f33a34857874648ed3e1d (patch) | |
tree | 24afe2fc6b17c776006a704fc9a7a172dc4c0a2c /pystache | |
parent | 998d48b9831cfdcada3219f6b4829e2472dd3acd (diff) | |
download | pystache-d94c5e1b64784980a87f33a34857874648ed3e1d.tar.gz |
Added a test case that dotted name resolution should make forward-only progress.
Diffstat (limited to 'pystache')
-rw-r--r-- | pystache/tests/test_renderengine.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pystache/tests/test_renderengine.py b/pystache/tests/test_renderengine.py index 667fa03..adbae7b 100644 --- a/pystache/tests/test_renderengine.py +++ b/pystache/tests/test_renderengine.py @@ -580,3 +580,16 @@ class RenderTests(unittest.TestCase, AssertStringMixin): expected = u' {{foo}} ' self._assert_render(expected, '{{=$ $=}} {{foo}} ') self._assert_render(expected, '{{=$ $=}} {{foo}} $={{ }}=$') # was yielding u' '. + + def test_dot_notation__forward_progress(self): + """ + Test that dotted name resolution makes "forward-only" progress. + + This is equivalent to the test case in the following pull request: + + https://github.com/mustache/spec/pull/48 + + """ + template = '{{a.b}} :: {{#c}}{{a}} :: {{a.b}}{{/c}}' + context = {'a': {'b': 'a.b found'}, 'c': {'a': 'a.b not found'} } + self._assert_render(u'a.b found :: a.b not found :: ', template, context) |