Skip to content

Commit

Permalink
Use already parsed JSON in ret.data
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb authored and s0undt3ch committed Nov 26, 2023
1 parent 27334a4 commit ab35c07
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/pytests/integration/ssh/state/test_state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json

import pytest

pytestmark = [
Expand Down Expand Up @@ -94,22 +92,12 @@ def test_state_low(salt_ssh_cli):
ret = salt_ssh_cli.run(
"state.low", '{"state": "cmd", "fun": "run", "name": "echo blah"}'
)
assert (
json.loads(ret.stdout)["localhost"]["cmd_|-echo blah_|-echo blah_|-run"][
"changes"
]["stdout"]
== "blah"
)
assert ret.data["cmd_|-echo blah_|-echo blah_|-run"]["changes"]["stdout"] == "blah"


def test_state_high(salt_ssh_cli):
"""
test state.high with salt-ssh
"""
ret = salt_ssh_cli.run("state.high", '{"echo blah": {"cmd": ["run"]}}')
assert (
json.loads(ret.stdout)["localhost"]["cmd_|-echo blah_|-echo blah_|-run"][
"changes"
]["stdout"]
== "blah"
)
assert ret.data["cmd_|-echo blah_|-echo blah_|-run"]["changes"]["stdout"] == "blah"

0 comments on commit ab35c07

Please sign in to comment.