spr migrated books, and tester

This commit is contained in:
buenosairesam
2025-12-31 09:07:27 -03:00
parent 21b8eab3cb
commit cccc6b5a93
136 changed files with 15763 additions and 472 deletions

View File

@@ -0,0 +1,36 @@
"""
Example health check test.
This is a fallback test that works without room-specific configuration.
Replace with room tests via cfg/<room>/tester/tests/
"""
import httpx
import pytest
class TestHealth:
"""Basic health check tests."""
@pytest.fixture
def base_url(self):
"""Base URL for the API under test."""
import os
return os.getenv("TEST_BASE_URL", "http://localhost:8000")
def test_health_endpoint(self, base_url):
"""Test that /health endpoint responds."""
try:
response = httpx.get(f"{base_url}/health", timeout=5)
assert response.status_code == 200
except httpx.ConnectError:
pytest.skip("API not running - set TEST_BASE_URL or start the service")
def test_root_endpoint(self, base_url):
"""Test that root endpoint responds."""
try:
response = httpx.get(base_url, timeout=5)
assert response.status_code in [200, 301, 302, 307, 308]
except httpx.ConnectError:
pytest.skip("API not running - set TEST_BASE_URL or start the service")