Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
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
django-pipeline
Commits
80b8b78c
Commit
80b8b78c
authored
Jul 10, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improving test coverage
parent
81a0f176
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
.gitignore
+2
-2
tests/static/js/dummy.coffee
+2
-0
tests/tests/compiler.py
+28
-1
No files found.
.gitignore
View file @
80b8b78c
...
...
@@ -9,4 +9,5 @@ MANIFEST
docs/_build/
*.egg-info
.coverage
htmlcov/
\ No newline at end of file
coverage/
tests/static/js/dummy.js
tests/static/js/dummy.coffee
0 → 100644
View file @
80b8b78c
square
=
(
x
)
->
x
*
x
cube
=
(
x
)
->
square
(
x
)
*
x
tests/tests/compiler.py
View file @
80b8b78c
from
django.test
import
TestCase
from
pipeline.compilers
import
Compiler
from
pipeline.conf
import
settings
from
pipeline.compilers
import
Compiler
,
CompilerBase
class
DummyCompiler
(
CompilerBase
):
output_extension
=
'js'
def
match_file
(
self
,
path
):
return
path
.
endswith
(
'.coffee'
)
def
compile_file
(
self
,
content
):
return
content
class
CompilerTest
(
TestCase
):
def
setUp
(
self
):
self
.
compiler
=
Compiler
()
self
.
old_compilers
=
settings
.
PIPELINE_COMPILERS
settings
.
PIPELINE_COMPILERS
=
[
'tests.tests.compiler.DummyCompiler'
,]
def
test_output_path
(
self
):
output_path
=
self
.
compiler
.
output_path
(
"js/helpers.coffee"
,
"js"
)
self
.
assertEquals
(
output_path
,
"js/helpers.js"
)
def
test_compilers_class
(
self
):
compilers_class
=
self
.
compiler
.
compilers
self
.
assertEquals
(
compilers_class
[
0
],
DummyCompiler
)
def
test_compile
(
self
):
paths
=
self
.
compiler
.
compile
([
'js/dummy.coffee'
,
'js/application.js'
,
])
self
.
assertEquals
([
'js/dummy.js'
,
'js/application.js'
],
paths
)
def
tearDown
(
self
):
settings
.
PIPELINE_COMPILERS
=
self
.
old_compilers
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