llama-stack-mirror/tests/unit/server
IAN MILLER 51affe5783
fix: fixed test_access_control.py unit test (#2876)
# What does this PR do?
<!-- Provide a short summary of what this PR does and why. Link to
relevant issues if applicable. -->
I fixed test_access_policy() function providing provider_model_id in
each register model endpoint to pass assertions.

Initially I faced this issue:
```
tests/unit/server/test_quota.py::test_authenticated_quota_allows_up_to_limit
tests/unit/server/test_quota.py::test_authenticated_quota_blocks_after_limit
tests/unit/server/test_quota.py::test_anonymous_quota_allows_up_to_limit
tests/unit/server/test_quota.py::test_anonymous_quota_blocks_after_limit
  /Users/iamiller/GitHub/llama-stack/.venv/lib/python3.12/site-packages/aiosqlite/core.py:105: DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
    result = function()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================== short test summary info ===============================================================================
FAILED tests/unit/server/test_access_control.py::test_access_policy - AssertionError: assert 'test_provider/model-1' == 'model-1'
==================================================================== 1 failed, 436 passed, 194 warnings in 20.09s ====================================================================
```

After resolved, all works:
```
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= 437 passed, 194 warnings in 19.41s =========================================================================
```

<!-- If resolving an issue, uncomment and update the line below -->
<!-- Closes #[issue-number] -->

## Test Plan
<!-- Describe the tests you ran to verify your changes with result
summaries. *Provide clear instructions so the plan can be easily
re-executed.* -->
Run ` ./scripts/unit-tests.sh`
2025-07-23 11:50:20 -07:00
..
test_access_control.py fix: fixed test_access_control.py unit test (#2876) 2025-07-23 11:50:20 -07:00
test_auth.py chore: default to pytest asyncio-mode=auto (#2730) 2025-07-11 13:00:24 -07:00
test_auth_github.py feat(auth): support github tokens (#2509) 2025-07-08 11:02:36 -07:00
test_quota.py feat(quota): add server‑side per‑client request quotas (requires auth) (#2096) 2025-05-21 10:58:45 +02:00
test_replace_env_vars.py chore(test): migrate unit tests from unittest to pytest for server en… (#2795) 2025-07-17 16:20:12 -07:00
test_resolver.py chore: default to pytest asyncio-mode=auto (#2730) 2025-07-11 13:00:24 -07:00
test_server.py fix: AccessDeniedError leads to HTTP 500 instead of error 403 (#2595) 2025-07-03 10:50:49 -07:00
test_sse.py chore: default to pytest asyncio-mode=auto (#2730) 2025-07-11 13:00:24 -07:00