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
f7f6b0e7
Commit
f7f6b0e7
authored
Aug 29, 2016
by
Solkaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CompilerWithEmptyFirstArg testcase
parent
c351c350
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
AUTHORS
+1
-0
pipeline/compilers/__init__.py
+2
-1
tests/tests/test_compiler.py
+26
-1
No files found.
AUTHORS
View file @
f7f6b0e7
...
...
@@ -59,6 +59,7 @@ or just made Pipeline more awesome.
* Jannis Leidel <jannis@leidel.info>
* Jared Scott <jscott@convertro.com>
* Jaromir Fojtu <jaromir.fojtu@gmail.com>
* Jeff Held <jheld135@gmail.com>
* Jon Dufresne <jon.dufresne@gmail.com>
* Josh Braegger <rckclmbr@gmail.com>
* Joshua Kehn <josh@kehn.us>
...
...
pipeline/compilers/__init__.py
View file @
f7f6b0e7
...
...
@@ -112,7 +112,8 @@ class SubProcessCompiler(CompilerBase):
else
:
argument_list
.
extend
(
flattening_arg
)
# Filter out empty elements in argument_list
# The first element in argument_list is the program that will be executed; if it is '', then
# a PermissionError will be raised. Thus empty arguments are filtered out from argument_list
argument_list
=
filter
(
None
,
argument_list
)
stdout
=
None
try
:
...
...
tests/tests/test_compiler.py
View file @
f7f6b0e7
...
...
@@ -42,6 +42,18 @@ class InvalidCompiler(SubProcessCompiler):
)
return
self
.
execute_command
(
command
)
class
CompilerWithEmptyFirstArg
(
SubProcessCompiler
):
output_extension
=
'junk'
def
match_file
(
self
,
path
):
return
path
.
endswith
(
'.coffee'
)
def
compile_file
(
self
,
infile
,
outfile
,
outdated
=
False
,
force
=
False
):
command
=
(
(
''
,
'/usr/bin/env'
,
'cat'
),
infile
,
)
return
self
.
execute_command
(
command
,
stdout_captured
=
outfile
)
class
CopyingCompiler
(
SubProcessCompiler
):
output_extension
=
'junk'
...
...
@@ -149,6 +161,20 @@ class CompilerSelfWriterTest(TestCase):
default_collector
.
clear
()
@pipeline_settings
(
COMPILERS
=
[
'tests.tests.test_compiler.CompilerWithEmptyFirstArg'
])
class
CompilerWithEmptyFirstArgTest
(
TestCase
):
def
setUp
(
self
):
default_collector
.
collect
()
self
.
compiler
=
Compiler
()
def
test_compile
(
self
):
paths
=
self
.
compiler
.
compile
([
_
(
'pipeline/js/dummy.coffee'
)])
default_collector
.
collect
()
self
.
assertEqual
([
_
(
'pipeline/js/dummy.junk'
)],
list
(
paths
))
def
tearDown
(
self
):
default_collector
.
clear
()
@pipeline_settings
(
COMPILERS
=
[
'tests.tests.test_compiler.InvalidCompiler'
])
class
InvalidCompilerTest
(
TestCase
):
def
setUp
(
self
):
...
...
@@ -158,7 +184,6 @@ class InvalidCompilerTest(TestCase):
def
test_compile
(
self
):
with
self
.
assertRaises
(
CompilerError
)
as
cm
:
self
.
compiler
.
compile
([
_
(
'pipeline/js/dummy.coffee'
)])
e
=
cm
.
exception
self
.
assertEqual
(
e
.
command
,
...
...
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