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
bdf21bd5
Commit
bdf21bd5
authored
Dec 06, 2013
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix regression in storage. close #288
parent
61783d94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
pipeline/storage.py
+2
-2
tests/settings.py
+1
-1
tests/tests/test_storage.py
+13
-8
No files found.
pipeline/storage.py
View file @
bdf21bd5
...
...
@@ -103,8 +103,8 @@ class BaseFinderStorage(PipelineStorage):
for
finder
in
self
.
finders
.
get_finders
():
path
=
finder
.
find
(
name
)
if
path
:
for
storage
_root
,
storage
in
finder
.
storages
.
item
s
():
if
path
.
startswith
(
storage
_root
):
for
storage
in
finder
.
storages
.
value
s
():
if
path
.
startswith
(
storage
.
location
):
return
path
,
storage
raise
ValueError
(
"The file '
%
s' could not be found with
%
r."
%
(
name
,
self
))
...
...
tests/settings.py
View file @
bdf21bd5
...
...
@@ -50,7 +50,7 @@ PIPELINE_CSS = {
'source_filenames'
:
(
'pipeline/css/first.css'
,
'pipeline/css/second.css'
,
'pipeline/css/urls.css'
,
'pipeline/css/urls.css'
),
'output_filename'
:
'screen.css'
}
...
...
tests/tests/test_storage.py
View file @
bdf21bd5
...
...
@@ -3,25 +3,30 @@ from __future__ import unicode_literals
from
django.test
import
TestCase
from
django.utils.datastructures
import
SortedDict
from
pipeline.storage
import
PipelineStorage
from
pipeline.storage
import
PipelineStorage
,
PipelineFinderStorage
from
tests.utils
import
pipeline_settings
class
StorageTest
(
TestCase
):
def
setUp
(
self
):
self
.
storage
=
PipelineStorage
()
def
test_post_process_dry_run
(
self
):
with
pipeline_settings
(
PIPELINE_JS_COMPRESSOR
=
None
,
PIPELINE_CSS_COMPRESSOR
=
None
):
processed_files
=
self
.
storage
.
post_process
([],
True
)
processed_files
=
PipelineStorage
()
.
post_process
([],
True
)
self
.
assertEqual
(
processed_files
,
[])
def
test_post_process
(
self
):
storage
=
PipelineStorage
()
with
pipeline_settings
(
PIPELINE_JS_COMPRESSOR
=
None
,
PIPELINE_CSS_COMPRESSOR
=
None
):
processed_files
=
s
elf
.
s
torage
.
post_process
(
SortedDict
({
'css/first.css'
:
(
s
elf
.
s
torage
,
'css/first.css'
),
'images/arrow.png'
:
(
s
elf
.
s
torage
,
'images/arrow.png'
)
processed_files
=
storage
.
post_process
(
SortedDict
({
'css/first.css'
:
(
storage
,
'css/first.css'
),
'images/arrow.png'
:
(
storage
,
'images/arrow.png'
)
}))
self
.
assertTrue
((
'css/first.css'
,
'css/first.css'
,
True
)
in
processed_files
)
self
.
assertTrue
((
'images/arrow.png'
,
'images/arrow.png'
,
True
)
in
processed_files
)
def
test_find_storage
(
self
):
try
:
storage
=
PipelineFinderStorage
()
storage
.
find_storage
(
'testing.css'
)
except
ValueError
:
self
.
fail
()
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