moo.shell.tests.test_editor

Functions

test_open_editor_extra_args_forwarded(...)

Extra positional args to open_editor() appear in the editor event dict.

test_open_editor_invalid_content_type_raises(...)

open_editor() raises UserError for an unrecognised content_type.

test_open_editor_non_wizard_raises(t_init, ...)

open_editor() raises UserError when the caller is not a wizard.

test_open_editor_publishes_editor_event(...)

Invoking a verb that calls open_editor() publishes an editor event dict to the player's Kombu queue (emitted as a RuntimeWarning in tests).

test_open_editor_python_content_type(t_init, ...)

content_type='python' is passed through to the editor event dict.

test_run_editor_cancel_flow()

Ctrl+C then Y cancels without saving and returns None.

test_run_editor_deny_resets_state()

Ctrl+S then N resets confirming state; subsequent Ctrl+C then Y cancels.

test_run_editor_get_status_text()

get_status_text returns the correct prompt for each confirming state.

test_run_editor_no_save_returns_none()

run_editor returns None when no key is pressed (application exits without saving).

test_run_editor_python_lexer_branch()

content_type='python' triggers the lexer lookup branch without error.

test_run_editor_save_flow()

Ctrl+S then Y saves the buffer and returns the initial text.