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:
imSp4rky
2026-05-21 10:45:25 -06:00
parent 9c905ef7a3
commit 746b573711
29 changed files with 2541 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
"""E2E: basic reachability against a running `unshackle serve`."""
from __future__ import annotations
import pytest
pytestmark = [pytest.mark.live]
def test_health_endpoint(http_session, server_url: str) -> None:
r = http_session.get(f"{server_url}/api/health", timeout=10)
assert r.status_code == 200, r.text
body = r.json()
assert body["status"] == "ok"
assert "version" in body
assert "update_check" in body
def test_services_endpoint(http_session, server_url: str) -> None:
r = http_session.get(f"{server_url}/api/services", timeout=10)
assert r.status_code == 200, r.text
body = r.json()
assert "services" in body
assert isinstance(body["services"], list)
def test_health_does_not_require_secret_key(server_url: str) -> None:
"""Health bypasses auth even when the server runs with a key."""
import requests
r = requests.get(f"{server_url}/api/health", timeout=10)
assert r.status_code == 200
def test_unknown_route_returns_404(http_session, server_url: str) -> None:
r = http_session.get(f"{server_url}/api/this-does-not-exist", timeout=10)
assert r.status_code in (404, 405)