Total Complexity | 1 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """test_read_user_variable.""" |
||
2 | import click |
||
3 | |||
4 | from cookiecutter.prompt import read_user_variable |
||
5 | |||
6 | VARIABLE = 'project_name' |
||
7 | DEFAULT = 'Kivy Project' |
||
8 | |||
9 | |||
10 | def test_click_invocation(mocker): |
||
11 | """Test click function called correctly by cookiecutter. |
||
12 | |||
13 | Test for string type invocation. |
||
14 | """ |
||
15 | prompt = mocker.patch('click.prompt') |
||
16 | prompt.return_value = DEFAULT |
||
17 | |||
18 | assert read_user_variable(VARIABLE, DEFAULT) == DEFAULT |
||
19 | |||
20 | click.prompt.assert_called_once_with(VARIABLE, default=DEFAULT) |
||
21 |