Skip to content

Commit

Permalink
Add test case to validate backend plugin load
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed May 9, 2024
1 parent 8e9cd4b commit 36e1a82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ pytest==5.2.4
pytest-cov==2.8.1
cov-core==1.15.0
sphinx==2.2.1
sphinx-rtd-theme==0.4.3
sphinx-rtd-theme==0.4.3
ovos-audio-plugin-simple~=0.0.1
ovos-plugin-vlc~=0.0.1
16 changes: 16 additions & 0 deletions test/unittests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ def test_audio_service_queue_methods(self, mock_load_services):

service.shutdown()

@mock.patch("ovos_audio.audio.Configuration")
def test_load_backends(self, mock_config):
mock_config.return_value = {}
service = AudioService(self.emitter)
service_names = set([s.name for s in service.service])
self.assertEqual(service_names,
{"ovos_common_play", "ovos_vlc", "ovos_simple"},
service_names)
service.shutdown()

service = AudioService(self.emitter, disable_ocp=True)
service_names = [s.name for s in service.service]
self.assertEqual(service_names, {"ovos_vlc", "ovos_simple"},
service_names)
service.shutdown()


if __name__ == "__main__":
unittest.main()

0 comments on commit 36e1a82

Please sign in to comment.