| Conditions | 2 |
| Total Lines | 28 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # -*- coding: utf-8 -*- |
||
| 26 | def test_determine_repository_url_should_clone( |
||
| 27 | mocker, template_url, output_dir, user_config_file, user_config_data): |
||
| 28 | """`clone()` should be called with correct args when `cookiecutter()` is |
||
| 29 | called. |
||
| 30 | """ |
||
| 31 | |||
| 32 | mock_clone = mocker.patch( |
||
| 33 | 'cookiecutter.repository.clone', |
||
| 34 | return_value='tests/fake-repo-tmpl', |
||
| 35 | autospec=True |
||
| 36 | ) |
||
| 37 | |||
| 38 | project_dir = determine_repo_dir( |
||
| 39 | template_url, |
||
| 40 | abbreviations={}, |
||
| 41 | cookiecutters_dir=user_config_data['cookiecutters_dir'], |
||
| 42 | checkout=None, |
||
| 43 | no_input=True |
||
| 44 | ) |
||
| 45 | |||
| 46 | mock_clone.assert_called_once_with( |
||
| 47 | repo_url=template_url, |
||
| 48 | checkout=None, |
||
| 49 | clone_to_dir=user_config_data['cookiecutters_dir'], |
||
| 50 | no_input=True |
||
| 51 | ) |
||
| 52 | |||
| 53 | assert os.path.isdir(project_dir) |
||
| 54 |