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
fe7f6511
Commit
fe7f6511
authored
May 04, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing_tags attribute validation.
parent
87dfefc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
pystache/renderer.py
+8
-1
pystache/tests/test_renderer.py
+13
-0
No files found.
pystache/renderer.py
View file @
fe7f6511
...
...
@@ -263,7 +263,14 @@ class Renderer(object):
Return whether missing_tags is set to strict.
"""
return
self
.
missing_tags
==
MissingTags
.
strict
val
=
self
.
missing_tags
if
val
==
MissingTags
.
strict
:
return
True
elif
val
==
MissingTags
.
ignore
:
return
False
raise
Exception
(
"Unsupported 'missing_tags' value:
%
s"
%
repr
(
val
))
def
_make_resolve_partial
(
self
):
"""
...
...
pystache/tests/test_renderer.py
View file @
fe7f6511
...
...
@@ -639,6 +639,19 @@ class Renderer_MakeRenderEngineTests(unittest.TestCase, AssertStringMixin, Asser
self
.
assertTrue
(
isinstance
(
s
,
unicode
))
self
.
assertEqual
(
type
(
escape
(
s
)),
unicode
)
## Test the missing_tags attribute.
def
test__missing_tags__unknown_value
(
self
):
"""
Check missing_tags attribute: setting an unknown value.
"""
renderer
=
Renderer
()
renderer
.
missing_tags
=
'foo'
self
.
assertException
(
Exception
,
"Unsupported 'missing_tags' value: 'foo'"
,
renderer
.
_make_render_engine
)
## Test the engine's resolve_context attribute.
def
test__resolve_context
(
self
):
...
...
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