Пример #1
0
class StorageTest(TestCase):
    def setUp(self):
        settings.PIPELINE_CSS = {
            'testing': {
                'source_filenames': (
                    _('pipeline/css/first.css'),
                    _('css/third.css'),
                ),
                'manifest': False,
                'output_filename': 'testing.css',
            }
        }
        settings.PIPELINE_JS_COMPRESSOR = None
        settings.PIPELINE_CSS_COMPRESSOR = None
        self.storage = PipelineStorage()

    def test_post_process_dry_run(self):
        processed_files = self.storage.post_process([], True)
        self.assertEqual(processed_files, [])

    def test_post_process(self):
        processed_files = self.storage.post_process(SortedDict({
            'css/first.css': (self.storage, 'css/first.css'),
            'images/arrow.png': (self.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 tearDown(self):
        settings.PIPELINE_CSS = {}
Пример #2
0
class StorageTest(TestCase):
    def setUp(self):
        settings.PIPELINE_CSS = {
            'testing': {
                'source_filenames': (
                    _('pipeline/css/first.css'),
                    _('css/third.css'),
                ),
                'manifest':
                False,
                'output_filename':
                'testing.css',
            }
        }
        settings.PIPELINE_JS_COMPRESSOR = None
        settings.PIPELINE_CSS_COMPRESSOR = None
        self.storage = PipelineStorage()

    def test_post_process_dry_run(self):
        processed_files = self.storage.post_process([], True)
        self.assertEqual(processed_files, [])

    def test_post_process(self):
        processed_files = self.storage.post_process(
            SortedDict({
                'css/first.css': (self.storage, 'css/first.css'),
                'images/arrow.png': (self.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 tearDown(self):
        settings.PIPELINE_CSS = {}
Пример #3
0
 def test_post_process(self):
     storage = PipelineStorage()
     with pipeline_settings(PIPELINE_JS_COMPRESSOR=None,
                            PIPELINE_CSS_COMPRESSOR=None):
         processed_files = storage.post_process({})
         self.assertTrue(('screen.css', 'screen.css',
                          True) in processed_files)
         self.assertTrue(('scripts.js', 'scripts.js',
                          True) in processed_files)
Пример #4
0
 def setUp(self):
     settings.PIPELINE_CSS = {
         'testing': {
             'source_filenames': (
                 'css/first.css',
                 'css/third.css',
             ),
             'manifest': False,
             'output_filename': 'testing.css',
         }
     }
     settings.PIPELINE_JS_COMPRESSOR = None
     settings.PIPELINE_CSS_COMPRESSOR = None
     self.storage = PipelineStorage()
Пример #5
0
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)
            self.assertEqual(processed_files, [])

    def test_post_process(self):
        with pipeline_settings(PIPELINE_JS_COMPRESSOR=None, PIPELINE_CSS_COMPRESSOR=None):
            processed_files = self.storage.post_process(SortedDict({
                'css/first.css': (self.storage, 'css/first.css'),
                'images/arrow.png': (self.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)
Пример #6
0
 def setUp(self):
     settings.PIPELINE_CSS = {
         'testing': {
             'source_filenames': (
                 'css/first.css',
             ),
             'manifest': False,
             'output_filename': 'testing.css',
         }
     }
     settings.PIPELINE_JS_COMPRESSOR = None
     settings.PIPELINE_CSS_COMPRESSOR = None
     self.storage = PipelineStorage()
Пример #7
0
class StorageTest(TestCase):
    def setUp(self):
        settings.PIPELINE_CSS = {
            'testing': {
                'source_filenames': (
                    'css/first.css',
                ),
                'manifest': False,
                'output_filename': 'testing.css',
            }
        }
        settings.PIPELINE_JS_COMPRESSOR = None
        settings.PIPELINE_CSS_COMPRESSOR = None
        self.storage = PipelineStorage()

    def test_listdir(self):
        files = self.storage.listdir()
        self.assertEqual(files, ([],['testing.css', 'scripts.css']))

    def tearDown(self):
        settings.PIPELINE_CSS = {}
Пример #8
0
 def test_post_process(self):
     storage = PipelineStorage()
     with pipeline_settings(PIPELINE_JS_COMPRESSOR=None, PIPELINE_CSS_COMPRESSOR=None):
         processed_files = storage.post_process({})
         self.assertTrue(('screen.css', 'screen.css', True) in processed_files)
         self.assertTrue(('scripts.js', 'scripts.js', True) in processed_files)
Пример #9
0
 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)
     self.assertTrue(('scripts.js', 'scripts.js', True) in processed_files)
Пример #10
0
 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)
     self.assertTrue(('scripts.js', 'scripts.js', True) in processed_files)
Пример #11
0
 def test_post_process_dry_run(self):
     default_collector.collect()
     processed_files = PipelineStorage().post_process({}, True)
     self.assertEqual(list(processed_files), [])
Пример #12
0
 def test_post_process_dry_run(self):
     with pipeline_settings(PIPELINE_JS_COMPRESSOR=None,
                            PIPELINE_CSS_COMPRESSOR=None):
         processed_files = PipelineStorage().post_process({}, True)
         self.assertEqual(list(processed_files), [])
Пример #13
0
 def test_post_process_dry_run(self):
     processed_files = PipelineStorage().post_process({}, True)
     self.assertEqual(list(processed_files), [])
Пример #14
0
 def setUp(self):
     self.storage = PipelineStorage()