diff --git a/tests/integration/test_astrolabe_chunk_context.py b/tests/integration/test_astrolabe_chunk_context.py index 847df157..c8ef1eee 100644 --- a/tests/integration/test_astrolabe_chunk_context.py +++ b/tests/integration/test_astrolabe_chunk_context.py @@ -25,6 +25,7 @@ import logging import re import uuid +import httpx import pytest from tests.conftest import create_mcp_client_session @@ -208,8 +209,6 @@ async def test_chunk_context_endpoint_uses_app_password( @pytest.mark.timeout(60) async def test_chunk_context_endpoint_requires_authentication(): """Direct HTTP hit at /api/v1/chunk-context without a bearer must 401.""" - import httpx - async with httpx.AsyncClient() as client: response = await client.get( "http://localhost:8003/api/v1/chunk-context", @@ -235,8 +234,6 @@ async def test_chunk_context_endpoint_rejects_invalid_bearer(): `validate_token_and_get_user`, which must turn into a clean 401/404 from the HTTP layer, not an opaque 500. """ - import httpx - async with httpx.AsyncClient() as client: response = await client.get( "http://localhost:8003/api/v1/chunk-context", diff --git a/tests/unit/test_management_chunk_context_endpoint.py b/tests/unit/test_management_chunk_context_endpoint.py index 04d3b0fc..e387a91a 100644 --- a/tests/unit/test_management_chunk_context_endpoint.py +++ b/tests/unit/test_management_chunk_context_endpoint.py @@ -193,12 +193,9 @@ class TestChunkContextCredentialPath: # Regression guard: credential resolution must go through the # app-password helper, not NextcloudClient.from_token. - mock_basic_auth.assert_awaited_once() - args, kwargs = mock_basic_auth.call_args - positional = list(args) - if "user_id" in kwargs: - positional.insert(0, kwargs["user_id"]) - assert positional[0] == "testuser" + mock_basic_auth.assert_awaited_once_with( + "testuser", "http://localhost:8080" + ) def test_not_provisioned_returns_401(self): """If the user has no stored app password, the handler must surface