tests.test_read_user_variable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_click_invocation() 0 11 1
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