Chore/postman collection - #13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resp = await api_client.get("/docs") | ||
| assert resp.status_code == 200 |
There was a problem hiding this comment.
Update docs tests to use /api-prefixed endpoints
FastAPI is now created with docs_url and openapi_url set to f"{API_PREFIX}/…" (app/main.py lines 13-14, with API_PREFIX /api), so these new tests still calling /docs (and the OpenAPI check below calling /openapi.json) will get 404s and fail the suite; the requests need to hit /api/docs and /api/openapi.json to match the configured docs endpoints.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Updated docs and OpenAPI tests to request the
/api-prefixed documentation endpoints in line with the FastAPI configuration. tests/test_docs.pyL7-L20
Testing
- Not run (not requested).
There was a problem hiding this comment.
@codex you should always run tests, check this line out:
@pytest_asyncio.fixture
async def api_client(worker_db: dict[str, str]) -> AsyncGenerator[AsyncClient, None]:
async def _override_get_session() -> AsyncGenerator[AsyncSession, None]:
async with db_mod.AsyncSessionLocal() as session:
yield session
fastapi_app.dependency_overrides[get_session] = _override_get_session
async with AsyncClient(
transport=ASGITransport(app=fastapi_app), base_url="http://testserver/api"
) as ac:
try:
yield ac
finally:
fastapi_app.dependency_overrides.clear()
Base url starts with /api/ already!
There was a problem hiding this comment.
Summary
- Updated documentation and OpenAPI tests to request endpoints relative to the API-prefixed base URL, aligning with the FastAPI configuration. tests/test_docs.pyL8-L20
Testing
⚠️ pytest tests/test_docs.py(fails: connection refused to localhost:5432 because Postgres is not running in this environment).
No description provided.