mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-06-17 06:27:35 +00:00
test(remote): add unit + e2e suite for remote-services subsystem
Covers RemoteClient/RemoteService, REST routes, handlers, SessionStore, InputBridge, DownloadQueueManager, errors, compression, and serve CLI. E2e tier opts in via --live and can auto-spawn its own serve.
This commit is contained in:
28
tests/remote/e2e/test_live_search.py
Normal file
28
tests/remote/e2e/test_live_search.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""E2E: search endpoint per service."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.live, pytest.mark.slow]
|
||||
|
||||
|
||||
def test_search_returns_results(http_session, server_url: str, service_case) -> None:
|
||||
service, conf = service_case
|
||||
query = conf.get("search_query")
|
||||
if not query:
|
||||
pytest.skip(f"no search_query configured for {service}")
|
||||
|
||||
r = http_session.post(
|
||||
f"{server_url}/api/search",
|
||||
json={"service": service, "query": query},
|
||||
timeout=120,
|
||||
)
|
||||
if r.status_code in (400, 401, 403):
|
||||
pytest.skip(f"{service} search not available: {r.status_code} {r.text[:200]}")
|
||||
if r.status_code == 502 and "not supported" in r.text.lower():
|
||||
pytest.skip(f"{service} does not implement search")
|
||||
assert r.status_code == 200, r.text
|
||||
body = r.json()
|
||||
assert "results" in body
|
||||
assert isinstance(body["results"], list)
|
||||
Reference in New Issue
Block a user