Speech history added, bound to fenrir+control+h.

This commit is contained in:
Storm Dragon
2026-05-20 21:02:56 -04:00
parent 4caef89f6b
commit ac7348895f
16 changed files with 611 additions and 3 deletions
+37
View File
@@ -164,6 +164,43 @@ def test_speak_text_drops_speech_when_cancel_holds_driver_lock():
speech_driver.speak.assert_not_called()
@pytest.mark.unit
def test_present_text_records_speech_history_when_enabled():
output_manager, _sound_driver, speech_driver = build_output_manager()
speech_history_manager = Mock(add_text=Mock())
output_manager.env["runtime"]["SpeechHistoryManager"] = (
speech_history_manager
)
output_manager.present_text("hello history", interrupt=False)
speech_history_manager.add_text.assert_called_once_with("hello history")
speech_driver.speak.assert_called_once()
@pytest.mark.unit
def test_present_text_does_not_record_when_speech_disabled():
output_manager, _sound_driver, speech_driver = build_output_manager()
speech_history_manager = Mock(add_text=Mock())
output_manager.env["runtime"]["SpeechHistoryManager"] = (
speech_history_manager
)
def _get_setting_as_bool(section, setting):
if (section, setting) == ("speech", "enabled"):
return False
return True
output_manager.env["runtime"][
"SettingsManager"
].get_setting_as_bool.side_effect = _get_setting_as_bool
output_manager.present_text("hello history", interrupt=False)
speech_history_manager.add_text.assert_not_called()
speech_driver.speak.assert_not_called()
@pytest.mark.unit
def test_key_interrupt_command_uses_nonblocking_interrupt():
module = load_key_interrupt_module()