Initial commit

Originally based off of mopidy-scrobbler code
This commit is contained in:
2023-01-08 01:08:18 -05:00
commit bbd1f5b5b7
14 changed files with 729 additions and 0 deletions

35
tests/test_extension.py Normal file
View File

@ -0,0 +1,35 @@
from unittest import mock
from mopidy_webhooks import Extension
from mopidy_webhooks import frontend as frontend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert "[webhooks]" in config
assert "enabled = true" in config
assert "username =" in config
assert "password =" in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert "username" in schema
assert "password" in schema
def test_setup():
ext = Extension()
registry = mock.Mock()
ext.setup(registry)
registry.add.assert_called_once_with(
"frontend", frontend_lib.WebhooksFrontend
)