Sprint 4 PR 4.6b — integration tests for teams router - #232
Merged
Merged
Conversation
Summary: extend the resurrected tests/integration/ tier with a fifth production-endpoint file that drives the /teams router over real HTTP against the session-scoped uvicorn api_server fixture. Covers create (admin gate, initial members, duplicate id, missing org), list envelope + org-scoped default + q-search, get + 404, update (admin gate), membership add/remove (admin gate, idempotent add, missing person 404), and delete (admin gate). Changed files: tests/integration/test_teams.py (new, 18 tests) Validation: poetry run pytest tests/integration/ -q # 76 passed poetry run pytest tests/integration/test_teams.py -v # 18 passed poetry run pytest tests/unit -q # 342 passed, 21 skipped poetry run black tests/integration/test_teams.py poetry run ruff check tests/integration/test_teams.py Follow-ups: continue file-by-file revival with events and availability routers under tests/integration/.
tomqwu
marked this pull request as ready for review
July 18, 2026 13:03
tomqwu
added a commit
that referenced
this pull request
Jul 18, 2026
Summary: Continues Sprint 4 PR 4.6b (file-by-file revival of the
tests/integration/ tier). Adds a sixth production-endpoint integration
file that drives the /availability router over real HTTP against the
session-scoped uvicorn api_server fixture. Exercises time-off, single-
date exceptions, and the recurring rrule per person.
Changed files: tests/integration/test_availability.py (new, 16 tests)
Validation:
poetry run pytest tests/integration/test_availability.py -v → 16 passed
poetry run pytest tests/integration/ → 91 passed
(with concurrent PR #232's test_teams.py also present locally)
poetry run pytest tests/unit -q → 342 passed, 21 skipped
poetry run black tests/integration/test_availability.py → clean
poetry run ruff check tests/integration/test_availability.py → clean
Coverage of /availability endpoints:
- POST /availability/ — first-time create + missing-person 404
- GET /availability/{person_id}/timeoff — empty state + list-after-add
- POST /availability/{person_id}/timeoff — success, invalid range 400, overlap 409
- PATCH /availability/{person_id}/timeoff/{id} — mutate dates + reason
- DELETE /availability/{person_id}/timeoff/{id} — removal
- GET /availability/{person_id}/exceptions — empty state
- POST /availability/{person_id}/exceptions — create + idempotency on duplicate
- DELETE /availability/{person_id}/exceptions/{id} — removal
- GET/PUT/DELETE /availability/{person_id}/rrule — get-when-null, set, idempotent clear
No OpenAPI snapshot refresh (no endpoints added or changed).
Follow-ups: continue file-by-file revival with the remaining routers
(events already up in PR #233, teams already up in PR #232).
Claude-Session: https://claude.ai/code/session_01CSAxAttZHQ5oLxLdcZZLt6
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues Sprint 4 PR 4.6b (file-by-file revival of the
tests/integration/tier). Adds a fifth production-endpoint integration file that drives the/teamsrouter over real HTTP against the session-scoped uvicornapi_serverfixture.Coverage
tests/integration/test_teams.py— 18 tests covering:POST /teams/— success, initial member seeding, admin gate (403 for volunteer), missing org 404, duplicate id 409GET /teams/— envelope shape, default org scoping,q=name/description searchGET /teams/{id}— success + 404PUT /teams/{id}— name/description update, admin gatePOST /teams/{id}/members— add, idempotent add, missing person 404, admin gateDELETE /teams/{id}/members— removeDELETE /teams/{id}— delete + follow-up 404, admin gateValidation
poetry run pytest tests/integration/— 76 passed (was 58)poetry run pytest tests/integration/test_teams.py -v— 18 passedpoetry run pytest tests/unit -q— 342 passed, 21 skippedpoetry run black tests/integration/test_teams.py— cleanpoetry run ruff check tests/integration/test_teams.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
teams_orgfixture so admin-gate vs volunteer-forbidden paths can both be exercised.q=test uses a unique marker in team names so the assertion isn't sensitive to unrelated teams from concurrent tests.Follow-ups
Next integration files to revive: events, availability.
Generated by Claude Code