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