Fix 5 failing tests: auth config + graduating_class field assertions #75

Closed
opened 2026-03-13 20:47:39 +00:00 by forgejo_admin · 0 comments

Lineage

plan-2026-03-08-tryout-prep → Phase 4 (Tryout day)

Repo

forgejo_admin/basketball-api

User Story

As a developer deploying basketball-api
I want all tests to pass on main
So that CI is green and I can build+push a deployable image

Context

5 tests fail on main after recent merges (checkin/uncheckin endpoints + graduating_class).

3 auth tests return 500 instead of 401/403:
The public_client fixture in test_tryouts.py doesn't set app.state.auth_config. The conftest.py client fixture does (line 83), but the local public_client skips it. Without auth_config, pal_e_auth._get_config() raises HTTP 500 "Auth not configured" instead of letting the auth chain return 401.

2 field assertion tests missing graduating_class:
PR #71 added graduating_class to the roster API response model, but the expected_fields sets in TestApiCheckIn and TestApiAssignNumber weren't updated.

File Targets

Files the agent should modify:

  • tests/test_tryouts.py — fix public_client fixture (add auth_config), add graduating_class to 2 expected field sets

Files the agent should NOT touch:

  • src/ — no production code changes needed
  • tests/conftest.py — already correct

Acceptance Criteria

  • When I run pytest tests/test_tryouts.py, then all 70 tests pass (0 failures)
  • When public_client hits a protected endpoint, then it returns 401 (not 500)

Test Expectations

  • Existing tests: all 70 pass
  • Run command: pytest tests/test_tryouts.py -v

Constraints

  • Match the pattern from conftest.py client fixture: from basketball_api.main import _auth_config; app.state.auth_config = _auth_config
  • Only modify test file, not production code

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • westside-basketball — project this affects
  • Blocks: basketball-api deployment to HEAD (9 commits behind)
### Lineage `plan-2026-03-08-tryout-prep` → Phase 4 (Tryout day) ### Repo `forgejo_admin/basketball-api` ### User Story As a developer deploying basketball-api I want all tests to pass on main So that CI is green and I can build+push a deployable image ### Context 5 tests fail on main after recent merges (checkin/uncheckin endpoints + graduating_class). **3 auth tests return 500 instead of 401/403:** The `public_client` fixture in `test_tryouts.py` doesn't set `app.state.auth_config`. The `conftest.py` `client` fixture does (line 83), but the local `public_client` skips it. Without `auth_config`, `pal_e_auth._get_config()` raises HTTP 500 "Auth not configured" instead of letting the auth chain return 401. **2 field assertion tests missing `graduating_class`:** PR #71 added `graduating_class` to the roster API response model, but the `expected_fields` sets in `TestApiCheckIn` and `TestApiAssignNumber` weren't updated. ### File Targets Files the agent should modify: - `tests/test_tryouts.py` — fix `public_client` fixture (add `auth_config`), add `graduating_class` to 2 expected field sets Files the agent should NOT touch: - `src/` — no production code changes needed - `tests/conftest.py` — already correct ### Acceptance Criteria - [ ] When I run `pytest tests/test_tryouts.py`, then all 70 tests pass (0 failures) - [ ] When `public_client` hits a protected endpoint, then it returns 401 (not 500) ### Test Expectations - [ ] Existing tests: all 70 pass - Run command: `pytest tests/test_tryouts.py -v` ### Constraints - Match the pattern from `conftest.py` `client` fixture: `from basketball_api.main import _auth_config; app.state.auth_config = _auth_config` - Only modify test file, not production code ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `westside-basketball` — project this affects - Blocks: basketball-api deployment to HEAD (9 commits behind)
forgejo_admin 2026-03-13 20:54:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#75
No description provided.