<commit_before>"""Tests for generating a continuous integration setup."""
from . import pytest_generate_tests  # noqa, pylint: disable=unused-import
from . import verify_file_matches_repo_root


# pylint: disable=too-few-public-methods
class TestCISetup:
    """
    Tests for verifying generated CI setups of this cookiecutter,
    executed several times with different values (test scenarios).
    """
    scenarios = [
        ('bitbucket', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'Bitbucket.org',
            'ci_service': 'bitbucket-pipelines.yml',
            'ci_testcommand': '        - tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('codeship', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitHub.com',
            'ci_service': 'codeship-steps.yml',
            'ci_testcommand': '  service: app',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('gitlab-shared', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitLab.com',
            'ci_service': '.gitlab-ci.yml',
            'ci_testcommand': '  script: tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target':
                '    TARGET: "myproject"',
        }),
        ('gitlab-dedicated', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitLab.com',
            'ci_service': '.gitlab-ci.yml',
            'ci_testcommand': '  script: tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'dedicated',
            'expected_ci_target':
                '    TARGET: "myproject-${CI_ENVIRONMENT_NAME}"',
        }),
        ('shippable', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'Bitbucket.org',
            'ci_service': 'shippable.yml',
            'ci_testcommand': '  - tox',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('travis', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',<commit_msg>Fix tests for environment strategy<commit_after>"""Tests for generating a continuous integration setup."""
from . import pytest_generate_tests  # noqa, pylint: disable=unused-import
from . import verify_file_matches_repo_root


# pylint: disable=too-few-public-methods
class TestCISetup:
    """
    Tests for verifying generated CI setups of this cookiecutter,
    executed several times with different values (test scenarios).
    """
    scenarios = [
        ('bitbucket', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'Bitbucket.org',
            'ci_service': 'bitbucket-pipelines.yml',
            'ci_testcommand': '        - tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('codeship', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitHub.com',
            'ci_service': 'codeship-steps.yml',
            'ci_testcommand': '  service: app',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('gitlab-shared', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitLab.com',
            'ci_service': '.gitlab-ci.yml',
            'ci_testcommand': '  script: tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target':
                '  TARGET: myproject',
        }),
        ('gitlab-dedicated', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'GitLab.com',
            'ci_service': '.gitlab-ci.yml',
            'ci_testcommand': '  script: tox -e py37',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'dedicated',
            'expected_ci_target':
                '    TARGET: myproject-production',
        }),
        ('shippable', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
            'vcs_platform': 'Bitbucket.org',
            'ci_service': 'shippable.yml',
            'ci_testcommand': '  - tox',
            'checks': 'flake8,pylint,bandit',
            'tests': 'py35,py36,py37,pypy3,behave',
            'container_platform': 'APPUiO',
            'environment_strategy': 'shared',
            'expected_ci_target': '',
        }),
        ('travis', {
            'project_slug': 'myproject',
            'vcs_account': 'painless-software',
{'fraction_non_alphanumeric': 0.14813031616112984, 'fraction_numerical': 0.014764885251163536, 'mean_word_length': 2.0866765725606737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '214026', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1922, 'n_words': 315}