<commit_before>from unittest.mock import patch

from organize.actions import Shell
from pathlib import Path


def test_shell_basic():
    shell = Shell("echo 'Hello World'")
    result = shell.run(simulate=True)
    assert not result

    result = shell.run(simulate=False)
    assert result["shell"] == {"output": "Hello World\n", "returncode": 0}


def test_shell_template_simulation():
    shell = Shell("echo '{msg}'", run_in_simulation=True)
    result = shell.run(msg="Hello", simulate=True)
    assert result["shell"] == {"output": "Hello\n", "returncode": 0}<commit_msg>update shell tests for windows<commit_after>from unittest.mock import patch

from organize.actions import Shell
from pathlib import Path


def test_shell_basic():
    shell = Shell("echo 'Hello World'")
    result = shell.run(simulate=True)
    assert not result

    result = shell.run(simulate=False)
    assert result["shell"] == {"output": "Hello World\n", "returncode": 0}


def test_shell_template_simulation():
    shell = Shell("echo '{msg}'", run_in_simulation=True)
    result = shell.run(msg="Hello", simulate=True)
    result = result["shell"]
    assert result["output"].strip() == "Hello"
    assert result["returncode"] == 0
{'fraction_non_alphanumeric': 0.14133114215283485, 'fraction_numerical': 0.003286770747740345, 'mean_word_length': 4.71830985915493, 'pattern_counts': {'":': 6, '<': 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': '1852157', 'n_tokens_mistral': 374, 'n_tokens_neox': 360, 'n_words': 99}