コード例 #1
0
ファイル: test_director.py プロジェクト: handroll/handroll
    def test_process_directory_triggers_pre_composition(self, signals):
        config = Configuration()
        site = self.factory.make_site()
        director = Director(config, site, [])
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        directory = os.path.join(site.path, 'directory')
        os.mkdir(directory)

        director.process_directory(directory)

        signals.pre_composition.send.assert_called_once_with(director)
コード例 #2
0
ファイル: test_director.py プロジェクト: iter8ve/handroll
    def test_process_directory_triggers_pre_composition(self, signals):
        config = Configuration()
        site = self.factory.make_site()
        director = Director(config, site, [])
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        directory = os.path.join(site.path, 'directory')
        os.mkdir(directory)

        director.process_directory(directory)

        signals.pre_composition.send.assert_called_once_with(director)
コード例 #3
0
ファイル: test_director.py プロジェクト: handroll/handroll
    def test_process_directory_ignores_templates(self):
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        director = Director(config, site, [])
        directory = os.path.join(director.catalog.templates_path, 'test')
        os.makedirs(directory)

        director.process_directory(directory)

        directory_output = os.path.join(
            config.outdir, director.catalog.TEMPLATES_DIR, 'test')
        self.assertFalse(os.path.exists(directory_output))
コード例 #4
0
ファイル: test_director.py プロジェクト: iter8ve/handroll
    def test_process_directory_ignores_templates(self):
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        director = Director(config, site, [])
        directory = os.path.join(director.catalog.templates_path, 'test')
        os.makedirs(directory)

        director.process_directory(directory)

        directory_output = os.path.join(config.outdir,
                                        director.catalog.TEMPLATES_DIR, 'test')
        self.assertFalse(os.path.exists(directory_output))
コード例 #5
0
ファイル: test_director.py プロジェクト: handroll/handroll
    def test_process_directory_ignores_directories_already_in_output(self):
        # Avoid processing directories in output for the same reason that
        # file processing is skipped.
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        directory = os.path.join(config.outdir, 'directory')
        os.mkdir(directory)
        director = Director(config, site, [])

        director.process_directory(directory)

        directory_output = os.path.join(config.outdir, 'outdir', 'directory')
        self.assertFalse(os.path.exists(directory_output))
コード例 #6
0
ファイル: test_director.py プロジェクト: iter8ve/handroll
    def test_process_directory_ignores_directories_already_in_output(self):
        # Avoid processing directories in output for the same reason that
        # file processing is skipped.
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        directory = os.path.join(config.outdir, 'directory')
        os.mkdir(directory)
        director = Director(config, site, [])

        director.process_directory(directory)

        directory_output = os.path.join(config.outdir, 'outdir', 'directory')
        self.assertFalse(os.path.exists(directory_output))