From d25a2b4293eef61186c6cb3b09c77728f9ec7dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Forslund?= Date: Sat, 28 Dec 2019 22:05:03 +0100 Subject: [PATCH] Rename audio/test_interface.py to test_utils.py This is more inline with the tests that are performed in the file. This also adds a test for stop_speaking --- .../audio/{test_interface.py => test_utils.py} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename test/unittests/audio/{test_interface.py => test_utils.py} (86%) diff --git a/test/unittests/audio/test_interface.py b/test/unittests/audio/test_utils.py similarity index 86% rename from test/unittests/audio/test_interface.py rename to test/unittests/audio/test_utils.py index 34563d3e18..cdf388e624 100644 --- a/test/unittests/audio/test_interface.py +++ b/test/unittests/audio/test_utils.py @@ -13,6 +13,8 @@ # limitations under the License. # import unittest +import unittest.mock as mock + from shutil import rmtree from threading import Thread from time import sleep @@ -22,9 +24,7 @@ from os.path import exists import mycroft.audio from mycroft.util import create_signal, check_for_signal -""" - Tests for public interface for audio interface -""" +"""Tests for public audio service utils.""" done_waiting = False @@ -58,6 +58,11 @@ class TestInterface(unittest.TestCase): sleep(2) self.assertTrue(done_waiting) + @mock.patch('mycroft.messagebus.send_func.send') + def test_stop_speaking(self, mock_send): + mycroft.audio.stop_speaking() + mock_send.assert_called_with('mycroft.audio.speech.stop') + if __name__ == "__main__": unittest.main()