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

        director.process_file(marker)

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

        director.process_file(marker)

        signals.pre_composition.send.assert_called_once_with(director)
コード例 #3
0
ファイル: test_director.py プロジェクト: handroll/handroll
    def test_process_file_ignores_templates(self):
        config = Configuration()
        site = self.factory.make_site()
        default = os.path.join(site.path, 'template.html')
        open(default, 'w').close()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        director = Director(config, site, [])

        director.process_file(default)

        default_output = os.path.join(config.outdir, 'template.html')
        self.assertFalse(os.path.exists(default_output))
コード例 #4
0
ファイル: test_director.py プロジェクト: iter8ve/handroll
    def test_process_file_ignores_templates(self):
        config = Configuration()
        site = self.factory.make_site()
        default = os.path.join(site.path, 'template.html')
        open(default, 'w').close()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        director = Director(config, site, [])

        director.process_file(default)

        default_output = os.path.join(config.outdir, 'template.html')
        self.assertFalse(os.path.exists(default_output))
コード例 #5
0
ファイル: test_director.py プロジェクト: handroll/handroll
    def test_process_file_ignores_files_already_in_output(self):
        # This condition is checked because the output directory can be within
        # the source (e.g., the default of storing results in 'output'). If
        # the watcher is watching for any changes in site source, then
        # processing files in the output directory could lead the watcher into
        # an infinite loop.
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        marker = os.path.join(config.outdir, 'marker.md')
        open(marker, 'w').close()
        director = Director(config, site, [])

        director.process_file(marker)

        marker_output = os.path.join(config.outdir, 'marker.html')
        self.assertFalse(os.path.exists(marker_output))
コード例 #6
0
ファイル: test_director.py プロジェクト: iter8ve/handroll
    def test_process_file_ignores_files_already_in_output(self):
        # This condition is checked because the output directory can be within
        # the source (e.g., the default of storing results in 'output'). If
        # the watcher is watching for any changes in site source, then
        # processing files in the output directory could lead the watcher into
        # an infinite loop.
        config = Configuration()
        site = self.factory.make_site()
        config.outdir = os.path.join(site.path, 'outdir')
        os.mkdir(config.outdir)
        marker = os.path.join(config.outdir, 'marker.md')
        open(marker, 'w').close()
        director = Director(config, site, [])

        director.process_file(marker)

        marker_output = os.path.join(config.outdir, 'marker.html')
        self.assertFalse(os.path.exists(marker_output))