test_extension.py 725 Bytes
Newer Older
Agate's avatar
Agate committed
1
from __future__ import unicode_literals
Agate's avatar
Agate committed
2

Agate's avatar
Agate committed
3
import mopidy_funkwhale
Agate's avatar
Agate committed
4
5


Agate's avatar
Agate committed
6
7
def test_get_default_config():
    ext = mopidy_funkwhale.Extension()
Agate's avatar
Agate committed
8

Agate's avatar
Agate committed
9
    config = ext.get_default_config()
Agate's avatar
Agate committed
10

Agate's avatar
Agate committed
11
12
13
    assert "[funkwhale]" in config
    assert "enabled = true" in config
    assert "url = https://demo.funkwhale.audio" in config
Agate's avatar
Agate committed
14
15
16
17
18
    assert "username =" in config
    assert "password =" in config
    assert "client_id =" in config
    assert "client_secret =" in config
    assert "verify_cert =" in config
Agate's avatar
Agate committed
19
20


Agate's avatar
Agate committed
21
22
def test_get_config_schema():
    ext = mopidy_funkwhale.Extension()
Agate's avatar
Agate committed
23

Agate's avatar
Agate committed
24
    schema = ext.get_config_schema()
Agate's avatar
Agate committed
25
26
27
    assert "url" in schema
    assert "username" in schema
    assert "password" in schema
Agate's avatar
Agate committed
28
    assert "cache_duration" in schema