Exemple #1
0
def test_bash_transform_sample():
    ok, content = bash_transform(
        code="sed 's/A/B/g'",
        content="ACTGA",
    )
    assert ok is True
    assert content == "BCTGB"
Exemple #2
0
def test_empty_stdin_is_skipped():
    ok, content = bash_transform(
        code="no such command",
        content="",
    )
    assert ok is True
    assert content == ""
Exemple #3
0
def test_bash_transform_error_is_captured():
    ok, content = bash_transform(
        code="ls /NO-SUCH-DIR",
        content="?",
    )
    assert ok is False
    assert "ls: cannot access" in content
    assert "/NO-SUCH-DIR" in content
    assert "No such file or directory" in content