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
844ebdbc
Commit
844ebdbc
authored
Apr 08, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up code comments in previous commit.
parent
6252e693
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
pystache/tests/test_spec.py
+8
-7
No files found.
pystache/tests/test_spec.py
View file @
844ebdbc
...
@@ -11,16 +11,18 @@ FILE_ENCODING = 'utf-8' # the encoding of the spec test files.
...
@@ -11,16 +11,18 @@ FILE_ENCODING = 'utf-8' # the encoding of the spec test files.
try
:
try
:
# We try yaml first since it is more convenient when adding and modifying
# test cases by hand (since the YAML is human-readable and is the master
# from which the JSON format is generated).
import
yaml
import
yaml
except
ImportError
:
except
ImportError
:
try
:
try
:
# We use the JSON files rather than the YAML files because json libraries
# are available for Python 2.4.
import
json
import
json
except
:
except
:
# The module json is not available prior to Python 2.6, whereas simplejson is.
# The module json is not available prior to Python 2.6, whereas
# Note that simplejson dropped support for Python 2.4 in simplejson v2.1.0,
# simplejson is. The simplejson package dropped support for Python 2.4
# so Python 2.4 requires a simplejson install older than the most recent.
# in simplejson v2.1.0, so Python 2.4 requires a simplejson install
# older than the most recent version.
import
simplejson
as
json
import
simplejson
as
json
file_extension
=
'json'
file_extension
=
'json'
parser
=
json
parser
=
json
...
@@ -48,7 +50,7 @@ def parse(u, file_extension):
...
@@ -48,7 +50,7 @@ def parse(u, file_extension):
u: a unicode string.
u: a unicode string.
"""
"""
#
F
ind a cleaner mechanism for choosing between the two.
#
TODO: f
ind a cleaner mechanism for choosing between the two.
if
file_extension
[
0
]
==
'j'
:
if
file_extension
[
0
]
==
'j'
:
# Then json.
# Then json.
...
@@ -75,7 +77,6 @@ def parse(u, file_extension):
...
@@ -75,7 +77,6 @@ def parse(u, file_extension):
return
yaml
.
load
(
u
)
return
yaml
.
load
(
u
)
# This test case lets us alert the user that spec tests are missing.
# This test case lets us alert the user that spec tests are missing.
class
CheckSpecTestsFound
(
unittest
.
TestCase
):
class
CheckSpecTestsFound
(
unittest
.
TestCase
):
...
...
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