Exemplo n.º 1
0
    def test_on_moved_for_file_regenerates_output(self):
        markdown = os.path.join(self.site.path, 'index.md')
        open(markdown, 'w').close()
        handler = SiteHandler(self.director)
        event = events.FileMovedEvent('', markdown)

        handler.on_moved(event)

        html = os.path.join(self.director.config.outdir, 'index.html')
        self.assertTrue(os.path.exists(html))
Exemplo n.º 2
0
    def test_on_moved_for_file_regenerates_output(self):
        markdown = os.path.join(self.site.path, 'index.md')
        open(markdown, 'w').close()
        handler = SiteHandler(self.director)
        event = events.FileMovedEvent('', markdown)

        handler.on_moved(event)

        html = os.path.join(self.director.config.outdir, 'index.html')
        self.assertTrue(os.path.exists(html))
Exemplo n.º 3
0
    def test_on_moved_for_directory_makes_new_directory(self):
        directory = os.path.join(self.site.path, 'directory')
        os.mkdir(directory)
        handler = SiteHandler(self.director)
        event = events.DirMovedEvent('', directory)

        handler.on_moved(event)

        out_directory = os.path.join(self.director.config.outdir, 'directory')
        self.assertTrue(os.path.exists(out_directory))
        self.assertTrue(os.path.isdir(out_directory))
Exemplo n.º 4
0
    def test_on_moved_for_directory_makes_new_directory(self):
        directory = os.path.join(self.site.path, 'directory')
        os.mkdir(directory)
        handler = SiteHandler(self.director)
        event = events.DirMovedEvent('', directory)

        handler.on_moved(event)

        out_directory = os.path.join(self.director.config.outdir, 'directory')
        self.assertTrue(os.path.exists(out_directory))
        self.assertTrue(os.path.isdir(out_directory))