test: cover the key markers and the keys line

Pins the markers that used to be unreachable (s-tab, home, bs, pgup, f5, a
repeat, a literal `<`), the two shapes of a wrong marker (unknown name, bad
repeat) coming back as an error from the tool instead of being typed, and the
pretty line naming the keys it sent.
This commit is contained in:
2026-10-24 02:03:40 +08:00
parent a2d8159267
commit dbb68e7273
2 changed files with 48 additions and 9 deletions
+3 -3
View File
@@ -806,13 +806,13 @@ async def test_pretty_pty_write_and_keys(capsys: pytest.CaptureFixture[str]) ->
await render_events(
_aiter(
[
_pretty_call("write_pty_keys", '{"session_id": 3, "data": "ctrl+c"}'),
_result("session_id=3\nalive=true\nexit_code=\nwrote=1"),
_pretty_call("write_pty_keys", '{"session_id": 3, "data": "<c-c><enter>"}'),
_result("session_id=3\nalive=true\nexit_code=\nwrote=2"),
]
)
)
out = capsys.readouterr().out
assert "* PTY Keys 3 (1 char)" in out
assert "* PTY Keys 3 '<c-c><enter>' (2 chars)" in out
async def test_pretty_ask_into_pty_never_shows_the_answer(capsys: pytest.CaptureFixture[str]) -> None: