Commit 7e0270b0 by Chris Jerdonek

Merge 'issue_70' into development: can now render views via Renderer.render().

parents aa8ad43d 7b7138b7
...@@ -10,6 +10,7 @@ import os ...@@ -10,6 +10,7 @@ import os
import sys import sys
import unittest import unittest
from examples.simple import Simple
from pystache import renderer from pystache import renderer
from pystache.renderer import Renderer from pystache.renderer import Renderer
from pystache.locator import Locator from pystache.locator import Locator
...@@ -394,6 +395,18 @@ class RendererTestCase(unittest.TestCase): ...@@ -394,6 +395,18 @@ class RendererTestCase(unittest.TestCase):
actual = renderer.render(say_hello, to='Mars') actual = renderer.render(say_hello, to='Mars')
self.assertEquals('Hello, Mars', actual) self.assertEquals('Hello, Mars', actual)
def test_render__view(self):
"""
Test rendering a View instance.
"""
renderer = Renderer()
view = Simple()
actual = renderer.render(view)
self.assertEquals('Hi pizza!', actual)
# By testing that Renderer.render() constructs the right RenderEngine, # By testing that Renderer.render() constructs the right RenderEngine,
# we no longer need to exercise all rendering code paths through # we no longer need to exercise all rendering code paths through
# the Renderer. It suffices to test rendering paths through the # the Renderer. It suffices to test rendering paths through the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment