Skip to content

Add JSONPlaceholder contract tests - #1

Merged
dkupratis-debug merged 1 commit into
mainfrom
cursor/api-test-suite-v1-e1eb
Nov 12, 2026
Merged

dkupratis-debug merged 1 commit into
mainfrom
cursor/api-test-suite-v1-e1eb

Conversation

@dkupratis-debug

Copy link
Copy Markdown
Owner

Summary

Practice suite that checks the JSONPlaceholder API contract for posts, users, and comments: status codes, JSON shape, field types, query filters, 404s, and the documented fake writes.

  • apitests/client.py is a small requests client with a base URL, timeout, and clear transport errors.
  • The default pytest run answers from recorded fixtures through the responses library, so CI does not need the network.
  • The same contract tests are marked live and stay skipped unless --live or API_TEST_LIVE=1 is set.
  • GitHub Actions runs ruff and mocked pytest on Python 3.11 and 3.12 for pushes and pull requests. Live tests are a separate manually triggered job.

Local verification

  • python -m ruff check . passed on Python 3.12.3 and 3.11.18.
  • python -m pytest: 28 passed, 24 skipped (the live copies).
  • python -m pytest --live: 52 passed, including calls to the real JSONPlaceholder API.
  • python -m pytest --live -m live and API_TEST_LIVE=1 python -m pytest -m live: 24 passed.

The README includes the pytest logs from the 3.12.3 run.

Test plan

  • Mocked pytest on Python 3.11 and 3.12
  • Live pytest against JSONPlaceholder
  • GitHub Actions ruff + mocked pytest on this PR head
Open in Web Open in Cursor 

Cover posts, users, and comments for status codes, JSON shape, field types, filters, 404s, and JSONPlaceholder's fake writes. The default run uses recorded fixtures so CI stays offline, and the same checks can opt in to the live API.

Co-authored-by: David Kupratis <dkupratis@student.bccc.edu>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T02:05:28.554570Z 14d06e0 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dkupratis-debug
dkupratis-debug merged commit f9b945f into main Nov 12, 2026
6 checks passed
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.

2 participants