about summary refs log tree commit diff
path: root/tests/test_gn3_case_attr_access.py
AgeCommit message (Collapse)Author
3 daystest(case-attr): remove stale BUG docstring from edit testClaude
The __population_privileges__ bug described in the docstring and assertion message of test_resource_owner_can_edit_returns_201 is fixed. Remove the stale description and simplify the assertion message. Also updates the Level 4 section comment (dropped the bug parenthetical). Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
3 daystest(case-attr): pre-provision resource-owner token per sessionClaude
Replace the per-invocation provisioned_token("resource-owner", ...) call in test_resource_owner_can_edit_returns_201 with a new session-scoped resource_owner_token fixture. One user is created and torn down per test session instead of per parametrized test invocation. Also fix the provisioned_token teardown URL: /auth/user/delete was moved to /auth/system/administration/users/delete. Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
3 daystest(gn3/case-attr): level 5 — data-curator approve/rejectClaude
Add fixtures and tests for approve/reject access control using a systemwide-data-curator token. conftest.py: - data_curator_oauth2_credentials: reads role "systemwide-data-curator" from GN_TEST_USERS_FILE; skips if absent. - data_curator_token: requests scope "profile group resource role user". tests/test_gn3_case_attr_access.py: - test_data_curator_can_approve_returns_200_or_201: parametrized over flat (/case-attribute/…) and v1 endpoints; asserts 200 or 201 (either proves the auth check passed). - test_data_curator_can_reject_returns_200_or_201: same for reject paths. Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
3 daysBugfix: Update to new URI.Frederick Muriuki Muriithi
3 daysFix under-provisioned scope for tokens.Frederick Muriuki Muriithi
6 daystest(gn3/case-attr): level 4 bug test — resource-owner edit returns 201Frederick Muriuki Muriithi
Adds provisioning fixtures and a parametrized test that assigns resource-owner role to a freshly created test user on the BXD population resource, then expects 201 from both the flat and v1 edit endpoints. The test is RED with current code because __population_privileges__ calls GET /auth/resource/<id>/roles without a Bearer token, so resource_privs is always empty and can_edit's resource_spec branch is never satisfied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 daystest(gn3/case-attr): level 2 access-control for approve and reject endpointsFrederick Muriuki Muriithi
Two parametrized tests covering both the flat /case-attribute/ blueprint and the v1 hierarchy for approve and reject diff operations: - test_no_privilege_approve_returns_401: basic token must get 401 - test_no_privilege_reject_returns_401: basic token must get 401 Expected RED on the flat endpoints (using old required_access helper with wrong privilege check); v1 endpoints already use can_apply_or_reject_edit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
6 daystest(gn3/case-attr): access-control level 1 & 2 for edit endpointsFrederick Muriuki Muriithi
Case-attribute names are public; tests cover only write endpoints. Two parametrized tests over both the flat /case-attribute/ and the new /api/v1/species/<s>/populations/<p>/case-attributes/ hierarchy: - test_no_token_edit_returns_400: POST /edit with no token must return 400 - test_no_privilege_edit_returns_401: POST /edit with unprivileged token must return 401 Both tests are expected RED until the can_edit privilege check is added to the flat and v1 edit endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>