Initial commit
Originally based off of mopidy-scrobbler code
This commit is contained in:
35
tests/test_extension.py
Normal file
35
tests/test_extension.py
Normal 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
|
||||
)
|
||||
Reference in New Issue
Block a user