Add scenario tests for the user resource policy
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Goal
The user policy chapter of api/adapters/resource_policy/KNOWLEDGE.md and the scenario tests under tests/scenario/bai_scenario/manager/resource_policy that match it one for one, with the report.md the run produces.
## Background
BA-7809 researched the resource policy adapter — one adapter over the keypair, user and project policies, 17 public calls over 20 wirings — and wrote its scenarios. Each policy gets its own chapter of api/adapters/resource_policy/KNOWLEDGE.md and its own PR, self-contained: the shared frame of the scenario component (the Family class, the givens and thens, the adapter conftest) is carried in every one of the three, and whichever merges first lands it.
The user policy has one optional value on create and one nullable limit on update — the concurrent-login cap — and a call that reads the caller's own policy straight off the user's row, so it has no not-found case. Its calls are create, get, search, update, purge and get-my — six.
## Acceptance criteria
- KNOWLEDGE.md holds the intro every policy shares and the user policy chapter: creating, reading by name, searching, editing, purging, reading one's own.
- Every row is a scenario in tests/scenario; every one of the six calls is reached; test-scenario and verify-scenario-report pass on CI.
- SeedUserPolicy takes a max_concurrent_logins, defaulting to None, so the row that clears the cap can lay a policy holding one; every existing report.md reads the same.
- No file under tests/scenario/bai_scenario/runner, seeder.py or components/answers.py changes.
## Related
- BA-7809 (the research)
- BA-7839, BA-7840, BA-7841 (behaviours the rows pin as they are today)
JIRA Issue: BA-7853
Contributor guide
Research direction
Read api/adapters/resource_policy/KNOWLEDGE.md and the matching files under tests/scenario/bai_scenario/manager/resource_policy, then compare the existing scenario structure and report.md output. Cover the six user-policy calls, including SeedUserPolicy's max_concurrent_logins, and verify completion with test-scenario and verify-scenario-report; leave runner, seeder.py, and components/answers.py unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100