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
4260e313
Commit
4260e313
authored
Mar 23, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a Loader test case (template attribute).
parent
a27c2915
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
pystache/custom_template.py
+1
-1
tests/common.py
+1
-0
tests/test_custom_template.py
+6
-2
No files found.
pystache/custom_template.py
View file @
4260e313
...
...
@@ -13,7 +13,7 @@ from .reader import Reader
from
.renderer
import
Renderer
# TODO:
rename this to Template?
# TODO:
consider renaming this to something like Template or TemplateInfo.
class
CustomizedTemplate
(
object
):
"""
...
...
tests/common.py
View file @
4260e313
...
...
@@ -14,6 +14,7 @@ def get_data_path(file_name):
return
os
.
path
.
join
(
DATA_DIR
,
file_name
)
# TODO: convert this to a mixin.
def
assert_strings
(
test_case
,
actual
,
expected
):
# Show both friendly and literal versions.
message
=
"""
\
...
...
tests/test_custom_template.py
View file @
4260e313
...
...
@@ -142,6 +142,11 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
"""
def
assertString
(
self
,
actual
,
expected
):
# TODO: use the assertStrings mixin.
self
.
assertEquals
(
type
(
actual
),
type
(
expected
))
self
.
assertEquals
(
actual
,
expected
)
def
test_init__defaults
(
self
):
loader
=
Loader
()
...
...
@@ -184,8 +189,7 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
template
.
template
=
"abc"
loader
=
Loader
()
self
.
assertEquals
(
loader
.
load
(
template
),
"wxy"
)
self
.
assertString
(
loader
.
load
(
template
),
u"abc"
)
# TODO: migrate these tests into the LoaderTests class.
...
...
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