Skip to content

Commit 9105ed2

Browse files
committed
Fixed tests based on updates
1 parent 962f8e9 commit 9105ed2

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

tests/test_cmd2.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ def test_set_with_choices(base_app) -> None:
279279
# Try a valid choice
280280
out, err = run_cmd(base_app, f"set fake {fake_choices[1]}")
281281
assert base_app.last_result is True
282-
assert not out
283-
assert err[0].startswith(f"fake: {fake_choices[0]!r}")
284-
assert err[1].endswith(f"-> {fake_choices[1]!r}")
282+
assert not err
283+
assert out[0].startswith("fake")
284+
assert out[0].endswith(f"-> {fake_choices[1]!r}")
285285

286286
# Try an invalid choice
287287
_out, err = run_cmd(base_app, "set fake bad_value")
@@ -856,14 +856,13 @@ def test_allow_clipboard(base_app) -> None:
856856

857857
def test_base_timing(base_app) -> None:
858858
out, err = run_cmd(base_app, "set timing True")
859-
assert not out
860-
assert err[0].startswith("timing: False")
861-
assert err[1].endswith("-> True")
859+
assert out[0].startswith("timing")
860+
assert out[0].endswith("-> True")
862861

863862
if sys.platform == "win32":
864-
assert err[2].startswith("Elapsed: 0:00:00")
863+
assert err[0].startswith("Elapsed: 0:00:00")
865864
else:
866-
assert err[2].startswith("Elapsed: 0:00:00.0")
865+
assert err[0].startswith("Elapsed: 0:00:00.0")
867866

868867

869868
def test_base_debug(base_app) -> None:
@@ -877,9 +876,9 @@ def test_base_debug(base_app) -> None:
877876

878877
# Set debug true
879878
out, err = run_cmd(base_app, "set debug True")
880-
assert not out
881-
assert err[0].startswith("debug: False")
882-
assert err[1].endswith("-> True")
879+
assert not err
880+
assert out[0].startswith("debug")
881+
assert out[0].endswith("-> True")
883882

884883
# Verify that we now see the exception traceback
885884
out, err = run_cmd(base_app, "edit")

tests/test_commandset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,9 @@ def __init__(self) -> None:
11031103

11041104
# change the value and verify the value changed
11051105
out, err = run_cmd(app, "set arbitrary_value 10")
1106-
assert not out
1107-
assert err[0].startswith("arbitrary_value: 5")
1108-
assert err[1].endswith("-> 10")
1106+
assert not err
1107+
assert out[0].startswith("arbitrary_value")
1108+
assert out[0].endswith("-> 10")
11091109
out, err = run_cmd(app, "set arbitrary_value")
11101110
any("arbitrary_value" in line and "10" in line for line in out)
11111111

0 commit comments

Comments
 (0)