示例#1
0
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()
示例#2
0
 def tearDown(self):
     tempdir.remove()
示例#3
0
 def test_removes_tempdir(self):
     tempdir.make()
     tempdir.remove()
     assert not os.path.exists(tempdir.path)
示例#4
0
 def tearDown(self):
     shutil.rmtree(self.dst_dir)
     tempdir.remove()
示例#5
0
 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)