

def test_discard(self):
    '\n        Test that we discard files properly\n        '
    self.site.external_manager.register_processor(DiscardingProcessor)
    self.site.external_manager.register_optimizer(SourceOptimizer)
    self.site.build()
    self.assertEqual(0, len(TestExternal.runs))
    self.assertFileDoesNotExist(os.path.join(self.site.build_path, 'static', 'test.dst'))
    self.assertFileDoesNotExist(os.path.join(self.site.build_path, 'static', 'test.src'))
    for static in self.site.static():
        if (static.src_filename == self.dummy_static):
            self.assertTrue(static.discarded)

dataset/ETHPy150Open koenbok/Cactus/cactus/tests/test_external.py TestStaticExternals.test_discard/original