Skip to content

Commit

Permalink
Merge pull request #537 from davidt/glob-exists
Browse files Browse the repository at this point in the history
Don't filter out "missing" files in the glob stage.
  • Loading branch information
cyberdelia committed Feb 16, 2016
2 parents 373a0f3 + b2be56f commit 0db06ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 1 addition & 6 deletions pipeline/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ def iglob(pathname):
"""
if not has_magic(pathname):
try:
if staticfiles_storage.exists(pathname):
yield pathname
except NotImplementedError:
# Being optimistic
yield pathname
yield pathname
return
dirname, basename = os.path.split(pathname)
if not dirname:
Expand Down
1 change: 0 additions & 1 deletion tests/tests/test_glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def test_glob_literal(self):
self.assertSequenceEqual(self.glob('a'), [self.normpath('a')])
self.assertSequenceEqual(self.glob('a', 'D'), [self.normpath('a', 'D')])
self.assertSequenceEqual(self.glob('aab'), [self.normpath('aab')])
self.assertSequenceEqual(self.glob('zymurgy'), [])

def test_glob_one_directory(self):
self.assertSequenceEqual(
Expand Down
5 changes: 4 additions & 1 deletion tests/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.test import TestCase
from django.test.utils import override_settings, modify_settings

from pipeline.collector import default_collector
from pipeline.storage import PipelineStorage

from tests.tests.test_compiler import DummyCompiler
Expand Down Expand Up @@ -49,11 +50,13 @@ def tearDown(self):

@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
def test_post_process_dry_run(self):
default_collector.collect()
processed_files = PipelineStorage().post_process({}, True)
self.assertEqual(list(processed_files), [])

@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None, COMPILERS=['tests.tests.test_storage.DummyCSSCompiler'])
def test_post_process(self):
default_collector.collect()
storage = PipelineStorage()
processed_files = storage.post_process({})
self.assertTrue(('screen.css', 'screen.css', True) in processed_files)
Expand Down

0 comments on commit 0db06ec

Please sign in to comment.