moo.shell.tests.test_prompt_raw_reader

Tests for MooPrompt._read_line_raw — the raw-mode line reader.

The real implementation reads keys from prompt_toolkit’s Input abstraction wired up by the contrib SSH session. Here we stub that abstraction: a fake Input returns scripted KeyPress sequences, and we assert the reader buffers, echoes, and terminates as expected.

Functions

test_read_line_raw_does_not_echo_input_back_to_channel()

Server-side echo would land as a duplicate copy in MUD clients that local-echo (Mudlet, MUSHclient, TinTin++).

test_read_line_raw_handles_partial_chunks()

Characters delivered across multiple read_keys() calls still produce one line.

test_read_line_raw_returns_line_without_crlf()

A sequence of character keys followed by Enter yields the decoded line without CR/LF.

test_read_line_raw_yields_none_on_eof()

Ctrl-D on an empty buffer signals EOF and returns None.