1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
from mopidy import config as config_lib
from mopidy.http import Extension
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert "[http]" in config
assert "enabled = true" in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert "enabled" in schema
assert "hostname" in schema
assert "port" in schema
assert "zeroconf" in schema
assert "allowed_origins" in schema
assert "csrf_protection" in schema
assert "default_app" in schema
def test_default_config_is_valid():
ext = Extension()
config = ext.get_default_config()
schema = ext.get_config_schema()
_, errors = config_lib.load([], [schema], [config], [])
assert errors.get("http") is None
|