"""PR-Worker-Pool-Registry-1A: /internal/worker/* 5 endpoint 503 stub 검증. conftest.py 의 async_client/db_session fixture 가 Phase 0 TODO 상태 (line 13) 이므로 본 모듈은 inline ASGI client 만 사용. DB schema (worker_capabilities, worker_heartbeats) 존재 검증은 deploy 후 curl + psql 로 별도 검증 (plan §A.9). 1B 활성화 시 conftest fixture 도 함께 활성화 검토. """ import pytest from httpx import ASGITransport, AsyncClient @pytest.fixture(scope="module") def anyio_backend(): return "asyncio" @pytest.mark.asyncio async def test_all_endpoints_return_503(): """5 endpoint (register/heartbeat/claim/result/drain) 모두 503 + detail 패턴 확인.""" from main import app # PYTHONPATH=app 환경에서 import async with AsyncClient( transport=ASGITransport(app=app), base_url="http://test", ) as ac: for ep in ("register", "heartbeat", "claim", "result", "drain"): r = await ac.post(f"/internal/worker/{ep}") assert r.status_code == 503, f"{ep}: expected 503, got {r.status_code}" assert "Registry-1A stub" in r.json()["detail"], ( f"{ep}: detail mismatch: {r.json()}" )