<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import os <EOL> import pytest <EOL> from cookiecutter import generate <EOL> from cookiecutter import utils <EOL> from cookiecutter import exceptions <EOL> @ pytest . fixture ( scope = '<STR_LIT>' ) <EOL> def remove_output_folder ( request ) : <EOL> """<STR_LIT>""" <EOL> def finalizer_remove_output_folder ( ) : <EOL> if os . path . exists ( '<STR_LIT>' ) : <EOL> utils . rmtree ( '<STR_LIT>' ) <EOL> request . addfinalizer ( finalizer_remove_output_folder ) <EOL> @ pytest . mark . usefixtures ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_output_folder ( ) : <EOL> context = generate . generate_context ( <EOL> context_file = '<STR_LIT>' <EOL> ) <EOL> generate . generate_files ( <EOL> context = context , <EOL> repo_dir = '<STR_LIT>' <EOL> ) <EOL> something = """<STR_LIT>""" <EOL> something2 = open ( '<STR_LIT>' ) . read ( ) <EOL> assert something == something2 <EOL> in_folder = "<STR_LIT>" <EOL> in_folder2 = open ( '<STR_LIT>' ) . read ( ) <EOL> assert in_folder == in_folder2 <EOL> assert os . path . isdir ( '<STR_LIT>' ) <EOL> assert os . path . isfile ( '<STR_LIT>' ) <EOL> @ pytest . mark . usefixtures ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_exception_when_output_folder_exists ( ) : <EOL> context = generate . generate_context ( <EOL> context_file = '<STR_LIT>' <EOL> ) <EOL> output_folder = context [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> if not os . path . exists ( output_folder ) : <EOL> os . makedirs ( output_folder ) <EOL> with pytest . raises ( exceptions . OutputDirExistsException ) : <EOL> generate . generate_files ( <EOL> context = context , <EOL> repo_dir = '<STR_LIT>' <EOL> ) </s>
