<s> import click <EOL> import pytest <EOL> from cookiecutter . prompt import read_user_choice <EOL> OPTIONS = [ '<STR_LIT:hello>' , '<STR_LIT>' , '<STR_LIT:foo>' , '<STR_LIT:bar>' ] <EOL> EXPECTED_PROMPT = """<STR_LIT>""" <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , enumerate ( OPTIONS , <NUM_LIT:1> ) ) <EOL> def test_click_invocation ( mocker , user_choice , expected_value ) : <EOL> choice = mocker . patch ( '<STR_LIT>' ) <EOL> choice . return_value = click . Choice ( OPTIONS ) <EOL> prompt = mocker . patch ( '<STR_LIT>' ) <EOL> prompt . return_value = '<STR_LIT:{}>' . format ( user_choice ) <EOL> assert read_user_choice ( '<STR_LIT>' , OPTIONS ) == expected_value <EOL> prompt . assert_called_once_with ( <EOL> EXPECTED_PROMPT , <EOL> type = click . Choice ( OPTIONS ) , <EOL> default = '<STR_LIT:1>' <EOL> ) <EOL> def test_raise_if_options_is_not_a_non_empty_list ( ) : <EOL> with pytest . raises ( TypeError ) : <EOL> read_user_choice ( '<STR_LIT:foo>' , '<STR_LIT>' ) <EOL> with pytest . raises ( ValueError ) : <EOL> read_user_choice ( '<STR_LIT:foo>' , [ ] ) </s>
