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
75030e7d
Commit
75030e7d
authored
Apr 07, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed TODO to rename _make_locator() to _make_loader().
parent
7341e367
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
pystache/tests/test_template_spec.py
+11
-12
No files found.
pystache/tests/test_template_spec.py
View file @
75030e7d
...
@@ -266,13 +266,12 @@ class SpecLoaderTests(unittest.TestCase, AssertIsMixin, AssertStringMixin):
...
@@ -266,13 +266,12 @@ class SpecLoaderTests(unittest.TestCase, AssertIsMixin, AssertStringMixin):
# TemplateSpec attributes or something).
# TemplateSpec attributes or something).
class
TemplateSpecTests
(
unittest
.
TestCase
):
class
TemplateSpecTests
(
unittest
.
TestCase
):
# TODO: rename this method to _make_loader().
def
_make_loader
(
self
):
def
_make_locator
(
self
):
return
SpecLoader
()
return
SpecLoader
()
def
_assert_template_location
(
self
,
view
,
expected
):
def
_assert_template_location
(
self
,
view
,
expected
):
lo
cator
=
self
.
_make_locato
r
()
lo
ader
=
self
.
_make_loade
r
()
actual
=
lo
cato
r
.
_find_relative
(
view
)
actual
=
lo
ade
r
.
_find_relative
(
view
)
self
.
assertEqual
(
actual
,
expected
)
self
.
assertEqual
(
actual
,
expected
)
def
test_find_relative
(
self
):
def
test_find_relative
(
self
):
...
@@ -334,13 +333,13 @@ class TemplateSpecTests(unittest.TestCase):
...
@@ -334,13 +333,13 @@ class TemplateSpecTests(unittest.TestCase):
Test _find() with a view that has a directory specified.
Test _find() with a view that has a directory specified.
"""
"""
lo
cator
=
self
.
_make_locato
r
()
lo
ader
=
self
.
_make_loade
r
()
view
=
SampleView
()
view
=
SampleView
()
view
.
template_rel_path
=
'foo/bar.txt'
view
.
template_rel_path
=
'foo/bar.txt'
self
.
assertTrue
(
lo
cato
r
.
_find_relative
(
view
)[
0
]
is
not
None
)
self
.
assertTrue
(
lo
ade
r
.
_find_relative
(
view
)[
0
]
is
not
None
)
actual
=
lo
cato
r
.
_find
(
view
)
actual
=
lo
ade
r
.
_find
(
view
)
expected
=
os
.
path
.
abspath
(
os
.
path
.
join
(
DATA_DIR
,
'foo/bar.txt'
))
expected
=
os
.
path
.
abspath
(
os
.
path
.
join
(
DATA_DIR
,
'foo/bar.txt'
))
self
.
assertEqual
(
actual
,
expected
)
self
.
assertEqual
(
actual
,
expected
)
...
@@ -350,19 +349,19 @@ class TemplateSpecTests(unittest.TestCase):
...
@@ -350,19 +349,19 @@ class TemplateSpecTests(unittest.TestCase):
Test _find() with a view that doesn't have a directory specified.
Test _find() with a view that doesn't have a directory specified.
"""
"""
lo
cator
=
self
.
_make_locato
r
()
lo
ader
=
self
.
_make_loade
r
()
view
=
SampleView
()
view
=
SampleView
()
self
.
assertTrue
(
lo
cato
r
.
_find_relative
(
view
)[
0
]
is
None
)
self
.
assertTrue
(
lo
ade
r
.
_find_relative
(
view
)[
0
]
is
None
)
actual
=
lo
cato
r
.
_find
(
view
)
actual
=
lo
ade
r
.
_find
(
view
)
expected
=
os
.
path
.
abspath
(
os
.
path
.
join
(
DATA_DIR
,
'sample_view.mustache'
))
expected
=
os
.
path
.
abspath
(
os
.
path
.
join
(
DATA_DIR
,
'sample_view.mustache'
))
self
.
assertEqual
(
actual
,
expected
)
self
.
assertEqual
(
actual
,
expected
)
def
_assert_get_template
(
self
,
custom
,
expected
):
def
_assert_get_template
(
self
,
custom
,
expected
):
lo
cator
=
self
.
_make_locato
r
()
lo
ader
=
self
.
_make_loade
r
()
actual
=
lo
cato
r
.
load
(
custom
)
actual
=
lo
ade
r
.
load
(
custom
)
self
.
assertEqual
(
type
(
actual
),
unicode
)
self
.
assertEqual
(
type
(
actual
),
unicode
)
self
.
assertEqual
(
actual
,
expected
)
self
.
assertEqual
(
actual
,
expected
)
...
...
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