Add native Wine accessibility bridge
This commit is contained in:
1 parent
0576b6f79f
commit
c9f56cb7ed
24 files changed
+1188
-8
No files matched your search
@@ -119,6 +119,45 @@ class NativeRemoteControllerTest(unittest.TestCase):
|
||||
self.assertEqual(dbus_service.CthulhuRemoteController.SERVICE_NAME, "org.stormux.Cthulhu1.Service")
|
||||
self.assertEqual(dbus_service.CthulhuRemoteController.OBJECT_PATH, "/org/stormux/Cthulhu1/Service")
|
||||
|
||||
@mock.patch("cthulhu.speech.speak")
|
||||
def test_speak_text_uses_direct_speech_output(self, speak):
|
||||
interface = dbus_service.CthulhuDBusServiceInterface()
|
||||
|
||||
self.assertTrue(interface.SpeakText("hello", True))
|
||||
speak.assert_called_once_with("hello", interrupt=True)
|
||||
|
||||
@mock.patch("cthulhu.braille.displayMessage")
|
||||
def test_braille_message_uses_persistent_flash(self, display_message):
|
||||
interface = dbus_service.CthulhuDBusServiceInterface()
|
||||
|
||||
self.assertTrue(interface.BrailleMessage("hello"))
|
||||
display_message.assert_called_once_with("hello", flashTime=-1)
|
||||
|
||||
@mock.patch("cthulhu.speech.stop")
|
||||
def test_cancel_speech_stops_output(self, stop):
|
||||
interface = dbus_service.CthulhuDBusServiceInterface()
|
||||
|
||||
self.assertTrue(interface.CancelSpeech())
|
||||
stop.assert_called_once_with()
|
||||
|
||||
def test_ssml_fails_closed(self):
|
||||
interface = dbus_service.CthulhuDBusServiceInterface()
|
||||
|
||||
self.assertEqual(interface.SpeakSsml("request", "<speak>Hello</speak>"), 50)
|
||||
self.assertEqual(interface.SpeakSsml("request", "not xml"), 87)
|
||||
|
||||
@mock.patch.object(dbus_service.CthulhuDBusServiceInterface, "PresentMessage")
|
||||
def test_accessible_event_normalizes_useful_fields(self, present_message):
|
||||
present_message.return_value = True
|
||||
interface = dbus_service.CthulhuDBusServiceInterface()
|
||||
|
||||
result = interface.PresentAccessibleEvent(
|
||||
"source", "focus", "Open", "button", "", "focused", "", 2, 4, "Settings"
|
||||
)
|
||||
|
||||
self.assertTrue(result)
|
||||
present_message.assert_called_once_with("Open, button, 2 of 4, Settings")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user