test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
-5
View File
@@ -30,8 +30,3 @@ def test_health_requires_secret_key(server_url: str, secret_key: str) -> None:
r = requests.get(f"{server_url}/api/health", timeout=10)
assert r.status_code == (401 if secret_key else 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)
@@ -7,18 +7,6 @@ import pytest
pytestmark = [pytest.mark.live]
def test_remote_client_get_health(remote_client) -> None:
body = remote_client.get("/api/health")
assert body["status"] == "ok"
assert "version" in body
def test_remote_client_get_services(remote_client) -> None:
body = remote_client.get("/api/services")
assert "services" in body
assert isinstance(body["services"], list)
def test_remote_client_get_404_raises_systemexit(remote_client) -> None:
with pytest.raises(SystemExit):
remote_client.get("/api/session/this-does-not-exist")
@@ -50,22 +50,6 @@ def delete_session(http_session, server_url: str, sid: str) -> None:
http_session.delete(f"{server_url}/api/session/{sid}", timeout=30)
def test_session_create_then_delete(http_session, server_url: str, service_case) -> None:
service, conf = service_case
sid = create_session(http_session, server_url, service, conf)
try:
r = http_session.get(f"{server_url}/api/session/{sid}", timeout=30)
assert r.status_code == 200
info = r.json()
assert info.get("session", {}).get("service_tag", service) == service or service in str(info)
finally:
delete_session(http_session, server_url, sid)
# After delete, info should 404
r2 = http_session.get(f"{server_url}/api/session/{sid}", timeout=30)
assert r2.status_code == 404
def test_session_titles_returns_list(http_session, server_url: str, service_case) -> None:
service, conf = service_case
sid = create_session(http_session, server_url, service, conf)
@@ -107,12 +91,3 @@ def test_session_tracks_for_first_title(http_session, server_url: str, service_c
assert body.get("video") or body.get("audio"), body
finally:
delete_session(http_session, server_url, sid)
def test_session_delete_idempotent_returns_404_after(http_session, server_url: str, service_case) -> None:
service, conf = service_case
sid = create_session(http_session, server_url, service, conf)
delete_session(http_session, server_url, sid)
r = http_session.delete(f"{server_url}/api/session/{sid}", timeout=30)
assert r.status_code in (404, 200) # tolerate both depending on server semantics