<commit_before># -*- coding: utf-8 -*-
import os

import pytest

from cookiecutter.repository import determine_repo_dir


@pytest.fixture
def template_url():
    """URL to example Cookiecutter template on GitHub.

    Note: when used, git clone is mocked.
    """
    return 'https://github.com/pytest-dev/cookiecutter-pytest-plugin.git'


@pytest.fixture
def output_dir(tmpdir):
    """Given a temporary dir, create an `output` subdirectory inside it and
    return its path (not a str but a py.path instance).
    """
    return tmpdir.mkdir('output')


def test_determine_repository_url_should_clone(
        mocker, template_url, output_dir, user_config_file, user_config_data):
    """`clone()` should be called with correct args when `cookiecutter()` is
    called.
    """

    mock_clone = mocker.patch(
        'cookiecutter.repository.clone',
        return_value='tests/fake-repo-tmpl',
        autospec=True
    )

    project_dir = determine_repo_dir(
        template_url,
        abbreviations={},
        clone_to_dir=user_config_data['cookiecutters_dir'],
        checkout=None,
        no_input=True
    )

    mock_clone.assert_called_once_with(
        repo_url=template_url,
        checkout=None,
        clone_to_dir=user_config_data['cookiecutters_dir'],
        no_input=True
    )

    assert os.path.isdir(project_dir)
<commit_msg>Remove unused fixtures<commit_after># -*- coding: utf-8 -*-
import os

import pytest

from cookiecutter.repository import determine_repo_dir


@pytest.fixture
def template_url():
    """URL to example Cookiecutter template on GitHub.

    Note: when used, git clone is mocked.
    """
    return 'https://github.com/pytest-dev/cookiecutter-pytest-plugin.git'


def test_determine_repository_url_should_clone(
        mocker, template_url, user_config_data):
    """`clone()` should be called with correct args when `cookiecutter()` is
    called.
    """

    mock_clone = mocker.patch(
        'cookiecutter.repository.clone',
        return_value='tests/fake-repo-tmpl',
        autospec=True
    )

    project_dir = determine_repo_dir(
        template_url,
        abbreviations={},
        clone_to_dir=user_config_data['cookiecutters_dir'],
        checkout=None,
        no_input=True
    )

    mock_clone.assert_called_once_with(
        repo_url=template_url,
        checkout=None,
        clone_to_dir=user_config_data['cookiecutters_dir'],
        no_input=True
    )

    assert os.path.isdir(project_dir)

{'fraction_non_alphanumeric': 0.10044372730939895, 'fraction_numerical': 0.0008067769261799112, 'mean_word_length': 3.1333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6033595', 'n_tokens_mistral': 803, 'n_tokens_neox': 781, 'n_words': 160}