Completed
Push — ensure-repos-have-context ( f450c5 )
by Michael
01:20
created

test_finds_local_repo()   A

Complexity

Conditions 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
from cookiecutter import repository, exceptions
3
4
import pytest
5
6
7
def test_finds_local_repo():
8
    project_dir = repository.determine_repo_dir(
9
        'tests/fake-repo',
10
        abbreviations={},
11
        clone_to_dir=None,
12
        checkout=None,
13
        no_input=True
14
    )
15
16
    assert 'tests/fake-repo' == project_dir
17
18
19
def test_local_repo_with_no_context_raises(user_config_data):
20
    """A repository without a cookiecutter.json should raise a
21
    `RepositoryNotFound` exception.
22
    """
23
    with pytest.raises(exceptions.RepositoryNotFound):
24
        repository.determine_repo_dir(
25
            'tests/fake-repo-bad',
26
            abbreviations={},
27
            clone_to_dir=user_config_data['cookiecutters_dir'],
28
            checkout=None,
29
            no_input=True
30
        )
31