summaryrefslogtreecommitdiff
path: root/pystache/renderengine.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2011-12-23 13:56:27 -0800
committerChris Jerdonek <chris.jerdonek@gmail.com>2011-12-23 14:06:30 -0800
commit17d62ebc02cbb859681a83a6a17ea4520685fb90 (patch)
tree4b343a9dc44fad65d65267184203f6c545a96273 /pystache/renderengine.py
parent6323e1cffae384553f42cec97324330d3fb995d4 (diff)
downloadpystache-17d62ebc02cbb859681a83a6a17ea4520685fb90.tar.gz
Changed the lone doctest to pass using "nosetests --with-doctest".
Apparently, nosetests runs doctests without the doctest.ELLIPSIS option enabled. This caused the Modifiers.set() test to fail.
Diffstat (limited to 'pystache/renderengine.py')
-rw-r--r--pystache/renderengine.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pystache/renderengine.py b/pystache/renderengine.py
index 0c144a7..0cf7c74 100644
--- a/pystache/renderengine.py
+++ b/pystache/renderengine.py
@@ -28,11 +28,13 @@ class Modifiers(dict):
Return a decorator that assigns the given function to the given key.
>>> modifiers = Modifiers()
+ >>>
>>> @modifiers.set('P')
- ... def render_tongue(self, tag_name=None, context=None):
- ... return ":P %s" % tag_name
- >>> modifiers
- {'P': <function render_tongue at 0x...>}
+ ... def render_tongue(tag_name, context):
+ ... return "%s :P" % context.get(tag_name)
+ >>>
+ >>> modifiers['P']('text', {'text': 'hello!'})
+ 'hello! :P'
"""
def decorate(func):