<commit_before>import pytest

from banneret.main import main, run_clean_command, run_archive_command, \
    run_docker_command, run_enable_errors_command


@pytest.fixture(name='mock_run_clean_command')
def fixture_mock_rcc(mocker):
    mock_rcc = mocker.patch('banneret.main.run_clean_command')
    yield mock_rcc


@pytest.fixture(name='mock_run_archive_command')
def fixture_mock_rac(mocker):
    mock_rac = mocker.patch('banneret.main.run_archive_command')
    yield mock_rac


@pytest.fixture(name='mock_run_docker_command')
def fixture_mock_rdc(mocker):
    mock_rdc = mocker.patch('banneret.main.run_docker_command')
    yield mock_rdc


@pytest.fixture(name='mock_input')
def fixture_mock_import(mocker):
    mock_input = mocker.patch('banneret.main.input')
    yield mock_input


@pytest.fixture(name='mock_remove_all')
def fixture_mock_remove_all(mocker):
    mock_remove_all = mocker.patch('banneret.main.remove_all')
    yield mock_remove_all


@pytest.fixture(name='mock_archive_project')
def fixture_mock_archive_project(mocker):
    mock_archive_project = mocker.patch('banneret.main.archive_project')
    yield mock_archive_project


@pytest.fixture(name='mock_clean_docker')
def fixture_mock_clean_docker(mocker):
    mock_clean_docker = mocker.patch('banneret.main.clean_docker')
    yield mock_clean_docker


@pytest.fixture(name='mock_enable_errors')
def fixture_mock_enable_errors(mocker):
    mock_enable_errors = mocker.patch('banneret.main.enable_errors')
    yield mock_enable_errors


@pytest.mark.usefixtures('command')
@pytest.mark.parametrize('command', [''], indirect=True)
class TestOSSupport:

    @pytest.mark.usefixtures('win32')
    def test_windows_is_not_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os: win32' in log.text

    @pytest.mark.usefixtures('linux')
    def test_linux_is_not_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os: linux' in log.text

    @pytest.mark.usefixtures('darwin')
    def test_mac_is_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os' not in log.text


@pytest.mark.usefixtures('command')
class TestRunCommand:

    @pytest.mark.parametrize('command', ['clean'], indirect=True)
    def test_clean(self, mock_run_clean_command):
        main()
        mock_run_clean_command.assert_called_once()

    @pytest.mark.parametrize('command', ['archive'], indirect=True)
    def test_archive(self, mock_run_archive_command):
        main()
        mock_run_archive_command.assert_called_once()

    @pytest.mark.parametrize('command', ['docker'], indirect=True)
    def test_docker(self, mock_run_docker_command):
        main()
        mock_run_docker_command.assert_called_once()

<commit_msg>Fix linux travis build<commit_after>import pytest

from banneret.main import main, run_clean_command, run_archive_command, \
    run_docker_command, run_enable_errors_command


@pytest.fixture(name='mock_run_clean_command')
def fixture_mock_rcc(mocker):
    mock_rcc = mocker.patch('banneret.main.run_clean_command')
    yield mock_rcc


@pytest.fixture(name='mock_run_archive_command')
def fixture_mock_rac(mocker):
    mock_rac = mocker.patch('banneret.main.run_archive_command')
    yield mock_rac


@pytest.fixture(name='mock_run_docker_command')
def fixture_mock_rdc(mocker):
    mock_rdc = mocker.patch('banneret.main.run_docker_command')
    yield mock_rdc


@pytest.fixture(name='mock_input')
def fixture_mock_import(mocker):
    mock_input = mocker.patch('banneret.main.input')
    yield mock_input


@pytest.fixture(name='mock_remove_all')
def fixture_mock_remove_all(mocker):
    mock_remove_all = mocker.patch('banneret.main.remove_all')
    yield mock_remove_all


@pytest.fixture(name='mock_archive_project')
def fixture_mock_archive_project(mocker):
    mock_archive_project = mocker.patch('banneret.main.archive_project')
    yield mock_archive_project


@pytest.fixture(name='mock_clean_docker')
def fixture_mock_clean_docker(mocker):
    mock_clean_docker = mocker.patch('banneret.main.clean_docker')
    yield mock_clean_docker


@pytest.fixture(name='mock_enable_errors')
def fixture_mock_enable_errors(mocker):
    mock_enable_errors = mocker.patch('banneret.main.enable_errors')
    yield mock_enable_errors


@pytest.mark.usefixtures('command')
@pytest.mark.parametrize('command', [''], indirect=True)
class TestOSSupport:

    @pytest.mark.usefixtures('win32')
    def test_windows_is_not_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os: win32' in log.text

    @pytest.mark.usefixtures('linux')
    def test_linux_is_not_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os: linux' in log.text

    @pytest.mark.usefixtures('darwin')
    def test_mac_is_supported(self, log):
        with pytest.raises(SystemExit):
            main()
        assert 'Wrong os' not in log.text


@pytest.mark.usefixtures('command', 'darwin')
class TestRunCommand:

    @pytest.mark.parametrize('command', ['clean'], indirect=True)
    def test_clean(self, mock_run_clean_command):
        main()
        mock_run_clean_command.assert_called_once()

    @pytest.mark.parametrize('command', ['archive'], indirect=True)
    def test_archive(self, mock_run_archive_command):
        main()
        mock_run_archive_command.assert_called_once()

    @pytest.mark.parametrize('command', ['docker'], indirect=True)
    def test_docker(self, mock_run_docker_command):
        main()
        mock_run_docker_command.assert_called_once()


{'fraction_non_alphanumeric': 0.11115025541659328, 'fraction_numerical': 0.0014091949973577594, 'mean_word_length': 4.835560123329907, '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': '7086526', 'n_tokens_mistral': 1976, 'n_tokens_neox': 1961, 'n_words': 278}