From cc960e7f2ea35a6f6de0f5127edab57d8dcaebe3 Mon Sep 17 00:00:00 2001 From: JarbasAi Date: Thu, 11 Jan 2024 19:23:52 +0000 Subject: [PATCH] feat/disable_audio_service puts it behind a config option, replaces --- test/unittests/test_speech.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/unittests/test_speech.py b/test/unittests/test_speech.py index 6c91279..1451bc1 100644 --- a/test/unittests/test_speech.py +++ b/test/unittests/test_speech.py @@ -286,27 +286,17 @@ def rcvm(msg): speech.handle_opm_g2p_query(Message("opm.g2p.query")) - @mock.patch('ovos_audio.service.get_audio_service_configs') - def test_opm_audio(self, mock_get_configs, tts_factory_mock, config_mock): + def test_opm_audio(self, tts_factory_mock, config_mock): setup_mocks(config_mock, tts_factory_mock) - ocp = {"type": "ovos_common_play", "active": True} - p = {"type": "ovos_badass_player", "active": True} - - # per module configs, mocking same return val for all plugin inputs (!) - mock_get_configs.return_value = {"ocp": ocp, "badass": p} - bus = FakeBus() speech = PlaybackService(bus=bus) def rcvm(msg): msg = json.loads(msg) self.assertEqual(msg["type"], "opm.audio.query.response") - self.assertEqual(msg["data"]["plugins"], ["ocp", "badass"]) - self.assertEqual(msg["data"]["configs"], {"ocp": ocp, "badass": p}) - ocp["plugin_name"] = 'Ovos Common Play' - p["plugin_name"] = 'Ovos Badass Player' - self.assertEqual(msg["data"]["options"], [ocp, p]) + self.assertEqual(msg["data"]["plugins"], []) + self.assertEqual(msg["data"]["configs"], {}) bus.on("message", rcvm)