def mkpresentation(ctx, presentation): """Make presentation project boilerplate""" if os.path.exists(presentation): error_echo("Error: '{}' already exists.".format(presentation)) ctx.exit(1) click.echo("Starting a new presentation...") make_presentation(presentation)
def test_make_presentation(self): path = os.path.join(tempfile.mkdtemp(), 'test') media_path = os.path.join(path, 'media') config_path = os.path.join(path, 'config.py') presentation_path = os.path.join(path, 'slides.md') make_presentation(path) self.assertTrue(os.path.isdir(path)) self.assertTrue(os.path.isdir(media_path)) self.assertTrue(os.path.isfile(config_path)) self.assertTrue(os.path.isfile(presentation_path))
def test_make_presentation(self): path = os.path.join(tempfile.mkdtemp(dir=self.tests_folder), "test") media_path = os.path.join(path, "media") config_path = os.path.join(path, "config.py") presentation_path = os.path.join(path, "slides.md") make_presentation(path) self.assertTrue(os.path.isdir(path)) self.assertTrue(os.path.isdir(media_path)) self.assertTrue(os.path.isfile(config_path)) self.assertTrue(os.path.isfile(presentation_path))