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

Function test_exit_code_default

tests/test_cmd2.py:3646–3657  ·  view source on GitHub ↗
(exit_code_repl, monkeypatch)

Source from the content-addressed store, hash-verified

3644
3645
3646def test_exit_code_default(exit_code_repl, monkeypatch) -> None:
3647 app = exit_code_repl
3648
3649 read_command_mock = mock.MagicMock(name="_read_command_line", return_value="exit")
3650 monkeypatch.setattr("cmd2.Cmd._read_command_line", read_command_mock)
3651
3652 expected = "exiting with code: 0\n"
3653
3654 # Run the command loop
3655 app.cmdloop()
3656 out = app.stdout.getvalue()
3657 assert out == expected
3658
3659
3660def test_exit_code_nonzero(exit_code_repl, monkeypatch) -> None:

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…