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

Function test_ctrl_d_at_prompt

tests/test_cmd2.py:1196–1205  ·  view source on GitHub ↗
(say_app, monkeypatch)

Source from the content-addressed store, hash-verified

1194
1195
1196def test_ctrl_d_at_prompt(say_app, monkeypatch) -> None:
1197 read_command_mock = mock.MagicMock(name="_read_command_line")
1198 read_command_mock.side_effect = ["say hello", EOFError()]
1199 monkeypatch.setattr("cmd2.Cmd._read_command_line", read_command_mock)
1200
1201 say_app.cmdloop()
1202
1203 # And verify the expected output to stdout
1204 out = say_app.stdout.getvalue()
1205 assert out == "hello\n\n"
1206
1207
1208@pytest.mark.skipif(

Callers

nothing calls this directly

Calls 2

cmdloopMethod · 0.80
getvalueMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…