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
bc6173e6
Commit
bc6173e6
authored
Jan 17, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Plain Diff
Merge 'issue_81' into development: added some RenderEngine unit test cases.
parents
f13b5801
54709f8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
tests/test_renderengine.py
+33
-0
No files found.
tests/test_renderengine.py
View file @
bc6173e6
...
...
@@ -177,6 +177,39 @@ class RenderTests(unittest.TestCase):
context
=
{
'test'
:
'{{#hello}}'
}
self
.
_assert_render
(
'{{#hello}}'
,
template
,
context
)
def
test_interpolation__built_in_type__string
(
self
):
"""
Check tag interpolation with a string on the top of the context stack.
"""
item
=
'abc'
# item.upper() == 'ABC'
template
=
'{{#section}}{{upper}}{{/section}}'
context
=
{
'section'
:
item
,
'upper'
:
'XYZ'
}
self
.
_assert_render
(
u'XYZ'
,
template
,
context
)
def
test_interpolation__built_in_type__integer
(
self
):
"""
Check tag interpolation with an integer on the top of the context stack.
"""
item
=
10
# item.real == 10
template
=
'{{#section}}{{real}}{{/section}}'
context
=
{
'section'
:
item
,
'real'
:
1000
}
self
.
_assert_render
(
u'1000'
,
template
,
context
)
def
test_interpolation__built_in_type__list
(
self
):
"""
Check tag interpolation with a list on the top of the context stack.
"""
item
=
[[
1
,
2
,
3
]]
# item[0].pop() == 3
template
=
'{{#section}}{{pop}}{{/section}}'
context
=
{
'section'
:
item
,
'pop'
:
7
}
self
.
_assert_render
(
u'7'
,
template
,
context
)
def
test_implicit_iterator__literal
(
self
):
"""
Test an implicit iterator in a literal tag.
...
...
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