Commit b2be56f9 by David Trowbridge

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.
parent 5604b07c
......@@ -55,7 +55,6 @@ class GlobTest(TestCase):
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(
......
......@@ -6,6 +6,7 @@ from django.core.management import call_command
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
......@@ -49,11 +50,13 @@ class StorageTest(TestCase):
@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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment