Skip to content

Commit b2be56f

Browse files
committed
Fix unit tests for glob updates.
The aforementioned change to `glob` surfaced a couple errors in the unit tests: 1. `test_glob_literal` was still testing the old behavior of non-existing paths being filtered out. 2. The post-process tests (`test_post_process_dry_run` and `test_post_process`) were now failing because post-process was being run without first collecting the media. This is a case where non-existing files were previously being filtered out silently but now cause an error. Running the collection stage before testing `post_process.
1 parent 5604b07 commit b2be56f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/tests/test_glob.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def test_glob_literal(self):
5555
self.assertSequenceEqual(self.glob('a'), [self.normpath('a')])
5656
self.assertSequenceEqual(self.glob('a', 'D'), [self.normpath('a', 'D')])
5757
self.assertSequenceEqual(self.glob('aab'), [self.normpath('aab')])
58-
self.assertSequenceEqual(self.glob('zymurgy'), [])
5958

6059
def test_glob_one_directory(self):
6160
self.assertSequenceEqual(

tests/tests/test_storage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from django.test import TestCase
77
from django.test.utils import override_settings, modify_settings
88

9+
from pipeline.collector import default_collector
910
from pipeline.storage import PipelineStorage
1011

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

5051
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
5152
def test_post_process_dry_run(self):
53+
default_collector.collect()
5254
processed_files = PipelineStorage().post_process({}, True)
5355
self.assertEqual(list(processed_files), [])
5456

55-
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
57+
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None, COMPILERS=['tests.tests.test_storage.DummyCSSCompiler'])
5658
def test_post_process(self):
59+
default_collector.collect()
5760
storage = PipelineStorage()
5861
processed_files = storage.post_process({})
5962
self.assertTrue(('screen.css', 'screen.css', True) in processed_files)

0 commit comments

Comments
 (0)