mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-30 13:05:08 +00:00
refactor(api): build list, search and session services through one launch_served
This commit is contained in:
@@ -3,7 +3,7 @@ from types import SimpleNamespace
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
from tests.remote.sessions import session_entry
|
||||
from tests.remote.sessions import session_entry, stub_service_build
|
||||
from unshackle.core.api import server_keys
|
||||
from unshackle.core.api.errors import APIError
|
||||
from unshackle.core.api.handlers import client_session_auth, resolve_handler_proxy, scrub_track_data
|
||||
@@ -354,7 +354,7 @@ def _run_session(monkeypatch, tmp_path, data, answer, server_account=False, fail
|
||||
monkeypatch.setattr(handlers, "server_account_for", lambda *args: server_account)
|
||||
monkeypatch.setattr(handlers, "next_server_profile", lambda *args: None)
|
||||
monkeypatch.setattr(handlers.Services, "load", lambda service: PromptingService)
|
||||
monkeypatch.setattr(handlers, "create_service_instance", lambda *a, **k: (PromptingService(), None, None))
|
||||
stub_service_build(monkeypatch, PromptingService)
|
||||
if data.get("cache") == "tokens":
|
||||
data["cache"] = {"tokens_default": base64.b64encode(zlib.compress(b"{}")).decode("ascii")}
|
||||
|
||||
@@ -440,7 +440,7 @@ def test_login_that_outlives_its_session_leaves_no_cache(monkeypatch, tmp_path):
|
||||
monkeypatch.setattr(handlers, "resolve_handler_proxy", lambda *args: (None, []))
|
||||
monkeypatch.setattr(handlers, "server_account_for", lambda *args: False)
|
||||
monkeypatch.setattr(handlers.Services, "load", lambda service: SlowPairingService)
|
||||
monkeypatch.setattr(handlers, "create_service_instance", lambda *a, **k: (SlowPairingService(), None, None))
|
||||
stub_service_build(monkeypatch, SlowPairingService)
|
||||
|
||||
async def run():
|
||||
resp = await handlers.session_create_handler({"service": "EXAMPLE", "title_id": "t"})
|
||||
|
||||
Reference in New Issue
Block a user