<s> """<STR_LIT>""" <EOL> import os <EOL> import pytest <EOL> from cookiecutter import replay , main , exceptions <EOL> def test_get_replay_file_name ( ) : <EOL> """<STR_LIT>""" <EOL> exp_replay_file_name = os . path . join ( '<STR_LIT:foo>' , '<STR_LIT>' ) <EOL> assert replay . get_file_name ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) == exp_replay_file_name <EOL> @ pytest . fixture ( params = [ <EOL> { '<STR_LIT>' : True } , <EOL> { '<STR_LIT>' : { } } , <EOL> { '<STR_LIT>' : True , '<STR_LIT>' : { } } , <EOL> ] ) <EOL> def invalid_kwargs ( request ) : <EOL> return request . param <EOL> def test_raise_on_invalid_mode ( invalid_kwargs ) : <EOL> with pytest . raises ( exceptions . InvalidModeException ) : <EOL> main . cookiecutter ( '<STR_LIT:foo>' , replay = True , ** invalid_kwargs ) <EOL> def test_main_does_not_invoke_dump_but_load ( mocker ) : <EOL> mock_prompt = mocker . patch ( '<STR_LIT>' ) <EOL> mock_gen_context = mocker . patch ( '<STR_LIT>' ) <EOL> mock_gen_files = mocker . patch ( '<STR_LIT>' ) <EOL> mock_replay_dump = mocker . patch ( '<STR_LIT>' ) <EOL> mock_replay_load = mocker . patch ( '<STR_LIT>' ) <EOL> main . cookiecutter ( '<STR_LIT>' , replay = True ) <EOL> assert not mock_prompt . called <EOL> assert not mock_gen_context . called <EOL> assert not mock_replay_dump . called <EOL> assert mock_replay_load . called <EOL> assert mock_gen_files . called <EOL> def test_main_does_not_invoke_load_but_dump ( mocker ) : <EOL> mock_prompt = mocker . patch ( '<STR_LIT>' ) <EOL> mock_gen_context = mocker . patch ( '<STR_LIT>' ) <EOL> mock_gen_files = mocker . patch ( '<STR_LIT>' ) <EOL> mock_replay_dump = mocker . patch ( '<STR_LIT>' ) <EOL> mock_replay_load = mocker . patch ( '<STR_LIT>' ) <EOL> main . cookiecutter ( '<STR_LIT>' , replay = False ) <EOL> assert mock_prompt . called <EOL> assert mock_gen_context . called <EOL> assert mock_replay_dump . called <EOL> assert not mock_replay_load . called <EOL> assert mock_gen_files . called </s>
