Skip to content

test(mocked): assert request bodies and 204/_seg on remaining write verbs - #202

Merged
millsmillsymills merged 1 commit into
mainfrom
test/issue-198-write-tool-body-seg-contracts
Jun 24, 2026
Merged

millsmillsymills merged 1 commit into
mainfrom
test/issue-198-write-tool-body-seg-contracts

Conversation

@millsmillsymills

Copy link
Copy Markdown
Collaborator

Summary

Test-only hardening. Three mocked write-tool tests had a contract assertion that their sibling verbs already make but they themselves omitted. This adds parity so every verb in each file asserts the same request-body / 204 / _seg percent-encoding contracts. No source changes.

Changes

  • tests/mocked/test_livedns_dnssec_tsig_writes.py — gandi_livedns_create_tsig_key now asserts the POST body is {} (mirrors the restore test's {"deleted": False} assertion).
  • tests/mocked/test_cert_tag_writes.py — add test_handles_204 for the PATCH path (gandi_cert_update_tags), matching the existing 204 cases on the PUT/DELETE paths.
  • tests/mocked/test_livedns_record_subresource_writes.py — add a percent-encoding parity case for gandi_livedns_replace_named_records (PUT /records/{name}) asserting the path is .../records/a%2Fb, matching the create/delete/typed cases.

Verification

  • uv run pytest tests/mocked/test_livedns_dnssec_tsig_writes.py tests/mocked/test_cert_tag_writes.py tests/mocked/test_livedns_record_subresource_writes.py -v → 31 passed.
  • uv run ruff check / ruff format --check / ty check all clean.
  • Mutation-checked the new TSIG body assertion (broke the client body, test failed; restored, test passed).

Closes #198

🤖 Generated with Claude Code

…erbs

Harden three write-tool mocked tests that omitted contract assertions
present on sibling verbs:

- gandi_livedns_create_tsig_key: assert the POST body is `{}`.
- gandi_cert_update_tags: add a 204 No Content case asserting `{}`.
- gandi_livedns_replace_named_records: add a percent-encoding parity
  case asserting the PUT path is `.../records/a%2Fb`.

No source changes; pure test hardening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@millsmillsymills
millsmillsymills merged commit e47e251 into main Jun 24, 2026
7 checks passed
@millsmillsymills
millsmillsymills deleted the test/issue-198-write-tool-body-seg-contracts branch June 24, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Write-tool tests: assert request bodies and 204/_seg contracts on remaining verbs

1 participant