Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
9b6b76c4
Commit
9b6b76c4
authored
Apr 01, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a unit test for rendering a TemplateSpec instance.
parent
a7e21be2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
tests/test_renderer.py
+19
-2
No files found.
tests/test_renderer.py
View file @
9b6b76c4
...
@@ -11,10 +11,12 @@ import sys
...
@@ -11,10 +11,12 @@ import sys
import
unittest
import
unittest
from
examples.simple
import
Simple
from
examples.simple
import
Simple
from
pystache.renderer
import
Renderer
from
pystache
import
Renderer
from
pystache
import
TemplateSpec
from
pystache.loader
import
Loader
from
pystache.loader
import
Loader
from
.common
import
get_data_path
from
.common
import
get_data_path
from
.common
import
AssertStringMixin
from
.data.views
import
SayHello
from
.data.views
import
SayHello
...
@@ -143,7 +145,7 @@ class RendererInitTestCase(unittest.TestCase):
...
@@ -143,7 +145,7 @@ class RendererInitTestCase(unittest.TestCase):
self
.
assertEquals
(
renderer
.
string_encoding
,
"foo"
)
self
.
assertEquals
(
renderer
.
string_encoding
,
"foo"
)
class
RendererTest
Case
(
unittest
.
TestCase
):
class
RendererTest
s
(
unittest
.
TestCase
,
AssertStringMixin
):
"""Test the Renderer class."""
"""Test the Renderer class."""
...
@@ -353,6 +355,21 @@ class RendererTestCase(unittest.TestCase):
...
@@ -353,6 +355,21 @@ 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__template_spec
(
self
):
"""
Test rendering a TemplateSpec instance.
"""
renderer
=
Renderer
()
class
Spec
(
TemplateSpec
):
template
=
"hello, {{to}}"
to
=
'world'
spec
=
Spec
()
actual
=
renderer
.
render
(
spec
)
self
.
assertString
(
actual
,
u'hello, world'
)
def
test_render__view
(
self
):
def
test_render__view
(
self
):
"""
"""
Test rendering a View instance.
Test rendering a View instance.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment