test_extension.py 703 B

1234567891011121314151617181920212223242526272829303132333435
  1. from unittest import mock
  2. from mopidy_webhooks import Extension
  3. from mopidy_webhooks import frontend as frontend_lib
  4. def test_get_default_config():
  5. ext = Extension()
  6. config = ext.get_default_config()
  7. assert "[webhooks]" in config
  8. assert "enabled = true" in config
  9. assert "username =" in config
  10. assert "password =" in config
  11. def test_get_config_schema():
  12. ext = Extension()
  13. schema = ext.get_config_schema()
  14. assert "username" in schema
  15. assert "password" in schema
  16. def test_setup():
  17. ext = Extension()
  18. registry = mock.Mock()
  19. ext.setup(registry)
  20. registry.add.assert_called_once_with(
  21. "frontend", frontend_lib.WebhooksFrontend
  22. )