Skip to content

Add API endpoint behavior tests - #45

Merged
Alajmah merged 1 commit into
mainfrom
api44
Jun 6, 2026
Merged

Alajmah merged 1 commit into
mainfrom
api44

Conversation

@Alajmah

@Alajmah Alajmah commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Tightens local command API coverage for Issue #44.

Changes

  • Adds direct health endpoint behavior coverage.
  • Adds direct command endpoint behavior coverage for a read-only project summary command.
  • Verifies API command execution records activity JSONL entries.
  • Keeps the API implementation unchanged because the local FastAPI app already exists.

Closes #44.

@Alajmah
Alajmah merged commit dd1895d into main Jun 6, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05ad02d284

ℹ️ 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".

Comment thread tests/test_api.py
Comment on lines +7 to +10
def _endpoint(app, path: str):
for route in app.routes:
if route.path == path:
return route.endpoint

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use TestClient for endpoint behavior tests

Because this helper returns the raw route function by path, the new /commands test bypasses FastAPI's HTTP method routing, request parsing, and response serialization. In the scenario this endpoint is accidentally registered with the wrong method or its API request/response handling regresses, run_command(CommandRequest(...)) can still pass even though real clients cannot call the endpoint. Use TestClient(app).post('/commands', json=...) for this coverage so the test actually protects the API contract.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add local command API

1 participant