()
| 1011 | |
| 1012 | |
| 1013 | def test_base_cmdloop_with_startup_commands() -> None: |
| 1014 | intro = "Hello World, this is an intro ..." |
| 1015 | |
| 1016 | # Need to patch sys.argv so cmd2 doesn't think it was called with arguments equal to the py.test args |
| 1017 | testargs = ["prog", "quit"] |
| 1018 | expected = intro + "\n" |
| 1019 | |
| 1020 | with mock.patch.object(sys, "argv", testargs): |
| 1021 | app = create_outsim_app() |
| 1022 | |
| 1023 | # Run the command loop with custom intro |
| 1024 | app.cmdloop(intro=intro) |
| 1025 | |
| 1026 | out = app.stdout.getvalue() |
| 1027 | assert out == expected |
| 1028 | |
| 1029 | |
| 1030 | def test_base_cmdloop_without_startup_commands(monkeypatch) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…