test_is_vcs_installed   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_is_vcs_installed() 0 13 1
1
# -*- coding: utf-8 -*-
2
3
"""Collection of tests around VCS detection."""
4
5
import pytest
6
7
from cookiecutter import vcs
8
9
10
@pytest.mark.parametrize('which_return, result', [
11
    ('', False),
12
    (None, False),
13
    (False, False),
14
    ('/usr/local/bin/git', True),
15
])
16
def test_is_vcs_installed(mocker, which_return, result):
17
    mocker.patch(
18
        'cookiecutter.vcs.which',
19
        autospec=True,
20
        return_value=which_return
21
    )
22
    assert vcs.is_vcs_installed('git') == result
23