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
78ac3e0d
Commit
78ac3e0d
authored
Mar 22, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separated LoaderTests into two test classes (as an interim step)..
parent
5628dadd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
tests/test_custom_template.py
+22
-13
No files found.
tests/test_custom_template.py
View file @
78ac3e0d
...
...
@@ -134,22 +134,12 @@ class ViewTestCase(unittest.TestCase):
self
.
assertEquals
(
view
.
render
(),
"""one, two, three, empty list"""
)
# TODO: switch these tests to using the CustomizedTemplate class instead of View.
# TODO: rename the get_template() tests to test load().
# TODO: condense, reorganize, and rename the tests so that it is
# clear whether we have full test coverage (e.g. organized by
# CustomizedTemplate attributes or something).
class
LoaderTests
(
unittest
.
TestCase
,
AssertIsMixin
):
# TODO: rename this method to _make_loader().
def
_make_locator
(
self
):
locator
=
Loader
(
search_dirs
=
[
DATA_DIR
])
return
locator
"""
Tests the custom_template.Loader class.
def
_assert_template_location
(
self
,
view
,
expected
):
locator
=
self
.
_make_locator
()
actual
=
locator
.
get_relative_template_location
(
view
)
self
.
assertEquals
(
actual
,
expected
)
"""
def
test_init__defaults
(
self
):
loader
=
Loader
([])
...
...
@@ -181,6 +171,25 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
self
.
assertIs
(
loader
.
locator
,
locator
)
# TODO: migrate these tests into the LoaderTests class.
# TODO: switch these tests to using the CustomizedTemplate class instead of View.
# TODO: rename the get_template() tests to test load().
# TODO: condense, reorganize, and rename the tests so that it is
# clear whether we have full test coverage (e.g. organized by
# CustomizedTemplate attributes or something).
class
ViewTests
(
unittest
.
TestCase
):
# TODO: rename this method to _make_loader().
def
_make_locator
(
self
):
locator
=
Loader
(
search_dirs
=
[
DATA_DIR
])
return
locator
def
_assert_template_location
(
self
,
view
,
expected
):
locator
=
self
.
_make_locator
()
actual
=
locator
.
get_relative_template_location
(
view
)
self
.
assertEquals
(
actual
,
expected
)
def
test_get_relative_template_location
(
self
):
"""
Test get_relative_template_location(): default behavior (no attributes set).
...
...
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