Skip to content

Commit

Permalink
Fix execute_command test
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimdrachov committed Jul 25, 2024
1 parent 15949ea commit 38aae49
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/cmd/execute_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ async def _unittest_basic(_context: tuple[Runner, tuple[Remote, Remote]]) -> Non
assert await run("10-12", "restart", "--timeout=3") == (
0,
{
"10": {"status": 0},
"11": {"status": 0},
"10": {"output": '', "status": 0},
"11": {"output": '', "status": 0},
},
)
assert await run("10-12", "111", "COMMAND ARGUMENT", "--timeout=3") == (
0,
{
"10": {"status": 0},
"11": {"status": 0},
"10": {"output": '', "status": 0},
"11": {"output": '', "status": 0},
},
)
assert (
Expand All @@ -122,15 +122,15 @@ async def _unittest_basic(_context: tuple[Runner, tuple[Remote, Remote]]) -> Non
assert await run("10-12", "restart", "--timeout=3") == (
EXIT_CODE_UNSUCCESSFUL,
{
"10": {"status": 100},
"11": {"status": 200},
"10": {"output": '', "status": 100},
"11": {"output": '', "status": 200},
},
)
assert await run("10-12", "123", "--expect=100,200", "--timeout=3") == (
0,
{
"10": {"status": 100},
"11": {"status": 200},
"10": {"output": '', "status": 100},
"11": {"output": '', "status": 200},
},
)
assert remote_10.last_request and remote_10.last_request.command == 123
Expand All @@ -143,22 +143,22 @@ async def _unittest_basic(_context: tuple[Runner, tuple[Remote, Remote]]) -> Non
EXIT_CODE_UNSUCCESSFUL,
{
"10": None,
"11": {"status": 0},
"11": {"output": '', "status": 0},
},
)
assert await run("10-12", "123", "--expect") == (
0,
{
"10": None,
"11": {"status": 0},
"11": {"output": '', "status": 0},
},
)

# FLAT OUTPUT (NOT GROUPED BY NODE-ID)
remote_11.next_response = ExecuteCommand_1.Response(status=210)
assert await run("11", "123", "FOO BAR", "--timeout=3") == (
EXIT_CODE_UNSUCCESSFUL,
{"status": 210},
{"output": '', "status": 210},
)
assert (
remote_11.last_request
Expand All @@ -167,7 +167,7 @@ async def _unittest_basic(_context: tuple[Runner, tuple[Remote, Remote]]) -> Non
)
assert await run("11", "222", "--timeout=3", "--expect=0..256") == (
0,
{"status": 210},
{"output": '', "status": 210},
)
assert (
remote_11.last_request
Expand Down

0 comments on commit 38aae49

Please sign in to comment.