def templates(directory, title): tempdir.make() context = {'title': title} template_names = env.list_templates() generate(template_names, context) dst_path = os.path.abspath(directory) tempdir.copy_files(template_names, dst_path) success_message(dst_path) tempdir.remove()
def tearDown(self): tempdir.remove()
def test_removes_tempdir(self): tempdir.make() tempdir.remove() assert not os.path.exists(tempdir.path)
def tearDown(self): shutil.rmtree(self.dst_dir) tempdir.remove()
def test_removes_file_that_has_name_of_tempdir(self): open(tempdir.dirname, 'w').close() assert os.path.isfile(tempdir.path) tempdir.remove() assert not os.path.exists(tempdir.path)