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
3313e1f5
Commit
3313e1f5
authored
Apr 23, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit tests for pystache/__init__.py.
parent
ca91b7fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
11 deletions
+42
-11
TODO.md
+2
-2
pystache/__init__.py
+4
-5
pystache/init.py
+0
-4
pystache/tests/test___init__.py
+36
-0
No files found.
TODO.md
View file @
3313e1f5
...
...
@@ -6,4 +6,5 @@ TODO
*
Provide support for logging in at least one of the commands.
*
Make sure doctest text files can be converted for Python 3 when using tox.
*
Make sure command parsing to pystache-test doesn't break with Python 2.4 and earlier.
*
Combine pystache-test with the main command.
\ No newline at end of file
*
Combine pystache-test with the main command.
*
Add a unittest that pystache.__version__ matches the version in setup.py.
pystache/__init__.py
View file @
3313e1f5
...
...
@@ -6,9 +6,8 @@ TODO: add a docstring.
# We keep all initialization code in a separate module.
# TODO: consider doing something like this instead:
# from pystache.init import __version__, render, Renderer, TemplateSpec
from
pystache.init
import
*
from
pystache.init
import
render
,
Renderer
,
TemplateSpec
# TODO: make sure that "from pystache import *" exposes only the following:
# ['__version__', 'render', 'Renderer', 'TemplateSpec']
# and add a unit test for this
.
__all__
=
[
'render'
,
'Renderer'
,
'TemplateSpec'
]
__version__
=
'0.5.1-alpha'
# Also change in setup.py
.
pystache/init.py
View file @
3313e1f5
...
...
@@ -9,10 +9,6 @@ from pystache.renderer import Renderer
from
pystache.template_spec
import
TemplateSpec
__all__
=
[
'__version__'
,
'render'
,
'Renderer'
,
'TemplateSpec'
]
__version__
=
'0.5.1-alpha'
# Also change in setup.py.
def
render
(
template
,
context
=
None
,
**
kwargs
):
"""
Return the given template string rendered using the given context.
...
...
pystache/tests/test___init__.py
0 → 100644
View file @
3313e1f5
# coding: utf-8
"""
Tests of __init__.py.
"""
# Calling "import *" is allowed only at the module level.
GLOBALS_INITIAL
=
globals
()
.
keys
()
from
pystache
import
*
GLOBALS_PYSTACHE_IMPORTED
=
globals
()
.
keys
()
import
unittest
import
pystache
class
InitTests
(
unittest
.
TestCase
):
def
test___all__
(
self
):
"""
Test that "from pystache import *" works as expected.
"""
actual
=
set
(
GLOBALS_PYSTACHE_IMPORTED
)
-
set
(
GLOBALS_INITIAL
)
expected
=
set
([
'render'
,
'Renderer'
,
'TemplateSpec'
,
'GLOBALS_INITIAL'
])
self
.
assertEqual
(
actual
,
expected
)
def
test_version_defined
(
self
):
"""
Test that pystache.__version__ is set.
"""
actual_version
=
pystache
.
__version__
self
.
assertTrue
(
actual_version
)
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