<commit_before>from .run import run


def test_run():
    status, result = run(['echo', 'hi'])
    assert status == 'success'
    assert result == 'hi\n'


def test_run_stdin():
    status, result = run(['cat'], input_data=b'hello')
    assert status == 'success'
    assert result == 'hello'


def test_run_timeout():
    status, result = run(['sleep', '1'], timeout=0.5)
    assert status == 'timed out after 0.5 seconds'
    assert result == "Command '['sleep', '1']' timed out after 0.5 seconds"


def test_run_not_found():
    status, result = run(['notfound'])
    assert status == 'not found'
    assert result == "[Errno 2] No such file or directory: 'notfound'"<commit_msg>fix run() tests<commit_after>from .run import run


def test_run():
    status, result, again = run(['echo', 'hi'])
    assert status == 'success'
    assert result == 'hi\n'
    assert again == False


def test_run_stdin():
    status, result, again = run(['cat'], input_data=b'hello')
    assert status == 'success'
    assert result == 'hello'
    assert again == False


def test_run_timeout():
    status, result, again = run(['sleep', '1'], timeout=0.5)
    assert status == 'timed out after 0.5 seconds'
    assert result == "Command '['sleep', '1']' timed out after 0.5 seconds"
    assert again == False


def test_run_not_found():
    status, result, again = run(['notfound'])
    assert status == 'not found'
    assert result == "[Errno 2] No such file or directory: 'notfound'"
    assert again == False
{'fraction_non_alphanumeric': 0.15620827770360482, 'fraction_numerical': 0.012016021361815754, 'mean_word_length': 3.6123076923076924, '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': '1431018', 'n_tokens_mistral': 476, 'n_tokens_neox': 457, 'n_words': 159}