MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_read_command_line_eof

Function test_read_command_line_eof

tests/test_cmd2.py:2220–2226  ·  view source on GitHub ↗

Test that _read_command_line passes up EOFErrors.

(base_app, monkeypatch)

Source from the content-addressed store, hash-verified

2218
2219
2220def test_read_command_line_eof(base_app, monkeypatch) -> None:
2221 """Test that _read_command_line passes up EOFErrors."""
2222 read_raw_mock = mock.MagicMock(name="_read_raw_input", side_effect=EOFError)
2223 monkeypatch.setattr("cmd2.Cmd._read_raw_input", read_raw_mock)
2224
2225 with pytest.raises(EOFError):
2226 base_app._read_command_line("Prompt> ")
2227
2228
2229def test_read_input_eof(base_app, monkeypatch) -> None:

Callers

nothing calls this directly

Calls 1

_read_command_lineMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…