mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-06-10 11:12:13 +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:
37
tests/remote/e2e/test_live_health.py
Normal file
37
tests/remote/e2e/test_live_health.py
Normal 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)
|
||||
Reference in New Issue
Block a user