Completed
Push — use-existing-cookiecutters ( 150cff...fc449e )
by Michael
01:26
created

test_should_find_existing_cookiecutter()   A

Complexity

Conditions 2

Size

Total Lines 16

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 16
rs 9.4285
1
# -*- coding: utf-8 -*-
2
import io
3
import os
4
5
from cookiecutter import repository
6
7
8
def test_should_find_existing_cookiecutter(user_config_data):
9
    template = 'cookiecutter-pytest-plugin'
10
    cookiecutters_dir = user_config_data['cookiecutters_dir']
11
    cloned_template_path = os.path.join(cookiecutters_dir, template)
12
    os.mkdir(cloned_template_path)
13
    io.open(os.path.join(cloned_template_path, 'cookiecutter.json'), 'w')
14
15
    project_dir = repository.determine_repo_dir(
16
        template,
17
        abbreviations={},
18
        clone_to_dir=cookiecutters_dir,
19
        checkout=None,
20
        no_input=True,
21
    )
22
23
    assert cloned_template_path == project_dir
24