Test initializing with custom settings.
(self, mock_cmd_app: MockCmd)
| 500 | assert completions[0].text == expected |
| 501 | |
| 502 | def test_init_with_custom_settings(self, mock_cmd_app: MockCmd) -> None: |
| 503 | """Test initializing with custom settings.""" |
| 504 | mock_parser = Mock() |
| 505 | custom_settings = utils.CustomCompletionSettings(parser=mock_parser) |
| 506 | completer = pt_utils.Cmd2Completer(cast(Any, mock_cmd_app), custom_settings=custom_settings) |
| 507 | |
| 508 | document = Document("", cursor_position=0) |
| 509 | |
| 510 | mock_cmd_app.complete.return_value = cmd2.Completions() |
| 511 | |
| 512 | list(completer.get_completions(document, None)) |
| 513 | |
| 514 | mock_cmd_app.complete.assert_called_once() |
| 515 | assert mock_cmd_app.complete.call_args[1]["custom_settings"] == custom_settings |
| 516 | |
| 517 | def test_get_completions_custom_delimiters(self, mock_cmd_app: MockCmd) -> None: |
| 518 | """Test that custom delimiters (terminators) are respected.""" |
nothing calls this directly
no test coverage detected