File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1288,6 +1288,20 @@ def test_multiline_complete_statement_with_unclosed_quotes(multiline_app):
12881288 assert statement .multiline_command == 'orate'
12891289 assert statement .terminator == ';'
12901290
1291+ def test_multiline_input_line_to_statement (multiline_app ):
1292+ # Verify _input_line_to_statement saves the fully entered input line for multiline commands
1293+
1294+ # Mock out the input call so we don't actually wait for a user's response
1295+ # on stdin when it looks for more input
1296+ m = mock .MagicMock (name = 'input' , side_effect = ['person' , '\n ' ])
1297+ builtins .input = m
1298+
1299+ line = 'orate hi'
1300+ statement = multiline_app ._input_line_to_statement (line )
1301+ assert statement .raw == 'orate hi\n person\n '
1302+ assert statement == 'hi person'
1303+ assert statement .command == 'orate'
1304+ assert statement .multiline_command == 'orate'
12911305
12921306def test_clipboard_failure (base_app , capsys ):
12931307 # Force cmd2 clipboard to be disabled
You can’t perform that action at this time.
0 commit comments