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

Function test_multiline_input_line_to_statement

tests/test_cmd2.py:1909–1919  ·  view source on GitHub ↗
(multiline_app, monkeypatch)

Source from the content-addressed store, hash-verified

1907
1908
1909def test_multiline_input_line_to_statement(multiline_app, monkeypatch) -> None:
1910 # Verify _input_line_to_statement saves the fully entered input line for multiline commands
1911 read_command_mock = mock.MagicMock(name="_read_command_line", side_effect=["person", "\n"])
1912 monkeypatch.setattr("cmd2.Cmd._read_command_line", read_command_mock)
1913
1914 line = "orate hi"
1915 statement = multiline_app._input_line_to_statement(line)
1916 assert statement.raw == "orate hi\nperson\n\n"
1917 assert statement == "hi person"
1918 assert statement.command == "orate"
1919 assert statement.multiline_command
1920
1921
1922def test_multiline_history_added(multiline_app, monkeypatch) -> None:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…