test_is_vcs_installed.test_is_vcs_installed()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
"""Collection of tests around VCS detection."""
2
import pytest
3
4
from cookiecutter import vcs
5
6
7
@pytest.mark.parametrize(
8
    'which_return, result',
9
    [('', False), (None, False), (False, False), ('/usr/local/bin/git', True)],
10
)
11
def test_is_vcs_installed(mocker, which_return, result):
12
    """Verify `is_vcs_installed` function correctly handles `which` answer."""
13
    mocker.patch('cookiecutter.vcs.which', autospec=True, return_value=which_return)
14
    assert vcs.is_vcs_installed('git') == result
15