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 | View Code Duplication | def test_should_find_existing_cookiecutter( |
|
0 ignored issues
–
show
Duplication
introduced
by
Loading history...
|
|||
27 | template, user_config_data, cloned_cookiecutter_path): |
||
28 | project_dir, cleanup = 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 | assert not cleanup |
||
38 |