Tighter integration with i38lock. Found and squished a bug with sound sometimes not loading.
This commit is contained in:
1 parent
0858ec441a
commit
40aeadb68a
11 files changed
+536
-3
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
import unittest
|
||||
import importlib
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
@@ -27,6 +28,19 @@ class PresentationInterruptSoundRegressionTests(unittest.TestCase):
|
||||
echoServer.stop.assert_called_once_with()
|
||||
soundPlayer.stop.assert_called_once_with()
|
||||
|
||||
def test_speech_icons_interrupt_previous_sound_when_speech_is_queued(self):
|
||||
soundPlayer = mock.Mock()
|
||||
|
||||
with tempfile.TemporaryDirectory() as temporaryDirectory:
|
||||
soundPath = Path(temporaryDirectory) / "button.wav"
|
||||
soundPath.write_bytes(b"RIFF")
|
||||
icon = speech.Icon(temporaryDirectory, "button.wav")
|
||||
|
||||
with mock.patch.object(speech.sound, "getPlayer", return_value=soundPlayer):
|
||||
speech.speak([icon], interrupt=False)
|
||||
|
||||
soundPlayer.play.assert_called_once_with(icon, interrupt=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user