Bug fixes in -x, things should read better now.
This commit is contained in:
@@ -67,6 +67,21 @@ def test_present_text_allows_sound_only_feedback():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_present_text_sound_icon_with_interrupt_cancels_speech():
|
||||
output_manager, sound_driver, speech_driver = build_output_manager()
|
||||
|
||||
output_manager.present_text(
|
||||
"end of screen", sound_icon="Accept", interrupt=True
|
||||
)
|
||||
|
||||
speech_driver.cancel.assert_called_once_with()
|
||||
sound_driver.play_sound_file.assert_called_once_with(
|
||||
"/tmp/Accept.wav", True
|
||||
)
|
||||
speech_driver.speak.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_play_sound_supports_error_alias():
|
||||
output_manager, sound_driver, _speech_driver = build_output_manager()
|
||||
@@ -227,3 +242,35 @@ def test_key_interrupt_command_uses_nonblocking_interrupt():
|
||||
|
||||
output_manager.interrupt_output_async.assert_called_once_with()
|
||||
output_manager.interrupt_output.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_key_interrupt_command_ignores_fenrir_shortcuts():
|
||||
module = load_key_interrupt_module()
|
||||
settings_manager = Mock()
|
||||
settings_manager.get_setting_as_bool.return_value = True
|
||||
settings_manager.get_setting.return_value = ""
|
||||
input_manager = Mock(
|
||||
no_key_pressed=Mock(return_value=False),
|
||||
get_curr_shortcut=Mock(return_value=[1, ["KEY_KP9"]]),
|
||||
get_command_for_shortcut=Mock(return_value="REVIEW_NEXT_LINE"),
|
||||
)
|
||||
output_manager = Mock()
|
||||
env = {
|
||||
"input": {
|
||||
"curr_input": ["KEY_KP9"],
|
||||
"prev_input": [],
|
||||
},
|
||||
"runtime": {
|
||||
"InputManager": input_manager,
|
||||
"OutputManager": output_manager,
|
||||
"ScreenManager": Mock(is_screen_change=Mock(return_value=False)),
|
||||
"SettingsManager": settings_manager,
|
||||
},
|
||||
}
|
||||
command = module.command()
|
||||
command.initialize(env)
|
||||
|
||||
command.run()
|
||||
|
||||
output_manager.interrupt_output_async.assert_not_called()
|
||||
|
||||
Reference in New Issue
Block a user