Beispiel #1
0
def test_movies():
    assert auth is not None
    resp = api.movies(auth['token'], 100, 500, False)
    assert has_keys(resp['movies'][0], ['id', 'title', 'description', 'hls_id'])
    assert resp['total'] > 0
    # Free movies
    resp = api.movies(auth['token'], 10, 0, True)
    assert has_keys(resp['movies'][0], ['id', 'title', 'description', 'hls_id'])
    assert resp['total'] > 0
Beispiel #2
0
def test_auth(credentials):
    global auth
    assert token is not None

    auth = api.auth(token['token'], *credentials.split(','))
    assert has_keys(auth, ['is_bound', 'token', 'expires'])
    assert auth['is_bound']
Beispiel #3
0
def test_status():
    assert auth is not None
    status = api.status(auth['token'])
    assert has_keys(status, ['is_bound', 'slot_count', 'state'])
    if status['is_bound']:
        devices = api.devices(auth['token'])
        plugin = next(d for d in devices if d['extid'] == api.DEVICE_ID)
        api.unbind_device(auth['token'], plugin['id'])
Beispiel #4
0
def _test_auth():
    global auth
    creds = os.getenv('CREDENTIALS')
    assert creds is not None
    assert token is not None

    auth = api.auth(token['token'], *creds.split(','))
    assert has_keys(auth, ['is_bound', 'token', 'expires'])
    assert auth['is_bound']
Beispiel #5
0
def test_regions():
    assert token is not None
    regions = api.regions(token['token'])
    assert has_keys(regions[0], ['extid', 'code', 'title'])
Beispiel #6
0
def test_token():
    global token
    token = api.token()
    assert has_keys(token, ['is_bound', 'token', 'expires'])
    assert not token['is_bound']
Beispiel #7
0
def test_episodes():
    assert auth is not None
    resp = api.episodes(auth['token'], 1122169)
    assert has_keys(resp['episodes'][0], ['id', 'title', 'description', 'number', 'hls_id'])
Beispiel #8
0
def test_seasons():
    assert auth is not None
    resp = api.seasons(auth['token'], 1121330)
    assert has_keys(resp['seasons'][0], ['id', 'title', 'description', 'number'])
Beispiel #9
0
def test_serials():
    assert auth is not None
    resp = api.serials(auth['token'], 100, 2)
    assert has_keys(resp['serials'][0], ['id', 'title', 'description', 'hls_id'])
    assert resp['total'] > 0
Beispiel #10
0
def assert_channels_resp(resp):
    assert isinstance(resp, dict)
    assert has_keys(resp['channels'][0], ['id', 'title', 'description', 'lcn', 'hls_id'])