Skip to content

Commit

Permalink
Add test case to validate backend plugin load (#62)
Browse files Browse the repository at this point in the history
* Add test case to validate backend plugin load

* Update dependency to test OpenVoiceOS/ovos-plugin-manager#224

* Update OPM dependency to pip spec

---------

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 9, 2024
1 parent e023333 commit bb83616
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ovos-utils~=0.0, >=0.0.38
ovos-bus-client~=0.0, >=0.0.8
ovos-config~=0.0,>=0.0.13a7
ovos-plugin-manager~=0.0, >=0.0.26a16
ovos-plugin-manager~=0.0, >=0.0.26a16
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 bb83616

Please sign in to comment.