Completed
Push — master ( 5a7563...ae5ace )
by
unknown
01:10
created

test_should_find_existing_cookiecutter()   A

Complexity

Conditions 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
1
# -*- coding: utf-8 -*-
2
import io
3
import os
4
import pytest
5
6
from cookiecutter import repository
7
8
9
@pytest.fixture
10
def template():
11
    return 'cookiecutter-pytest-plugin'
12
13
14
@pytest.fixture
15
def cloned_cookiecutter_path(user_config_data, template):
16
    cookiecutters_dir = user_config_data['cookiecutters_dir']
17
18
    cloned_template_path = os.path.join(cookiecutters_dir, template)
19
    os.mkdir(cloned_template_path)
20
21
    io.open(os.path.join(cloned_template_path, 'cookiecutter.json'), 'w')
22
23
    return cloned_template_path
24
25
26
def test_should_find_existing_cookiecutter(
27
        template, user_config_data, cloned_cookiecutter_path):
28
    project_dir = repository.determine_repo_dir(
29
        template,
30
        abbreviations={},
31
        clone_to_dir=user_config_data['cookiecutters_dir'],
32
        checkout=None,
33
        no_input=True,
34
    )
35
36
    assert cloned_cookiecutter_path == project_dir
37