Skip to content

Commit 25d254e

Browse files
author
Yoshihiro Takahara
committed
test: add pipeline execution success test case
1 parent a0800d5 commit 25d254e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_shell_executor_pipeline.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,22 @@ async def test_pipeline_split():
3232
commands = executor._split_pipe_commands(["echo", "hello", "|"])
3333
assert len(commands) == 1
3434
assert commands[0] == ["echo", "hello"]
35+
36+
37+
@pytest.mark.asyncio
38+
async def test_pipeline_execution_success():
39+
"""Test successful pipeline execution with proper return value"""
40+
executor = ShellExecutor()
41+
import os
42+
43+
os.environ["ALLOWED_COMMANDS"] = "echo,grep"
44+
45+
result = await executor.execute(
46+
["echo", "hello world", "|", "grep", "world"], directory="/tmp", timeout=5
47+
)
48+
49+
assert result["error"] is None
50+
assert result["status"] == 0
51+
assert "world" in result["stdout"]
52+
assert "execution_time" in result
53+
assert result["directory"] == "/tmp"

0 commit comments

Comments
 (0)