<commit_before>from python_utility.command_process import CommandProcess


def test_command_process(capfd) -> None:
    process = CommandProcess(
        arguments=['echo', 'hello']
    )

    assert process.get_return_code() == 0
    assert process.get_standard_output() == 'hello'
    assert process.get_standard_error() == ''

    process.print_output()
    standard_output, standard_error = capfd.readouterr()
    assert standard_output == 'hello\n'
    assert standard_error == ''<commit_msg>test failing command<commit_after>import pytest

from python_utility.command_process import CommandProcess, CommandFailed


def test_command_process(capfd) -> None:
    process = CommandProcess(arguments=['echo', 'hello'])

    assert process.get_return_code() == 0
    assert process.get_standard_output() == 'hello'
    assert process.get_standard_error() == ''

    process.print_output()
    standard_output, standard_error = capfd.readouterr()
    assert standard_output == 'hello\n'
    assert standard_error == ''


def test_command_fails() -> None:
    with pytest.raises(CommandFailed):
        CommandProcess(arguments=['ls', 'does-not-exist'])
{'fraction_non_alphanumeric': 0.11642050390964379, 'fraction_numerical': 0.0017376194613379669, 'mean_word_length': 4.565217391304348, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '7563461', 'n_tokens_mistral': 339, 'n_tokens_neox': 331, 'n_words': 67}