Skip to content

Commit 1c8f252

Browse files
committed
Correcting variable and return types to be AuthTuple.
1 parent 50fcb59 commit 1c8f252

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

tests/integration/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from sqlalchemy.engine import Engine
1212

1313
from authentication.noop import NoopAuthDependency
14+
from authentication.interface import AuthTuple
1415

1516
from configuration import configuration
1617
from models.database.base import Base
@@ -117,7 +118,7 @@ def test_request_fixture() -> Request:
117118

118119

119120
@pytest.fixture(name="test_auth")
120-
async def test_auth_fixture(test_request: Request) -> tuple[str, str, bool, str]:
121+
async def test_auth_fixture(test_request: Request) -> AuthTuple:
121122
"""Create authentication using real noop auth module.
122123
123124
This uses the actual NoopAuthDependency instead of mocking,

tests/integration/endpoints/test_config_integration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from fastapi import Request
66

7+
from authentication.interface import AuthTuple
8+
79
from configuration import AppConfig, LogicError
810
from app.endpoints.config import config_endpoint_handler
911

@@ -12,7 +14,7 @@
1214
async def test_config_endpoint_returns_config(
1315
test_config: AppConfig,
1416
test_request: Request,
15-
test_auth: tuple[str, str, bool, str],
17+
test_auth: AuthTuple,
1618
) -> None:
1719
"""Test that config endpoint returns test configuration.
1820
@@ -37,7 +39,7 @@ async def test_config_endpoint_returns_config(
3739
async def test_config_endpoint_returns_current_config(
3840
current_config: AppConfig,
3941
test_request: Request,
40-
test_auth: tuple[str, str, bool, str],
42+
test_auth: AuthTuple,
4143
) -> None:
4244
"""Test that config endpoint returns current configuration (from root).
4345
@@ -61,7 +63,7 @@ async def test_config_endpoint_returns_current_config(
6163
@pytest.mark.asyncio
6264
async def test_config_endpoint_fails_without_configuration(
6365
test_request: Request,
64-
test_auth: tuple[str, str, bool, str],
66+
test_auth: AuthTuple,
6567
) -> None:
6668
"""Test that authorization fails when configuration is not loaded.
6769

tests/integration/endpoints/test_info_integration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from fastapi import HTTPException, Request, status
88
from llama_stack_client import APIConnectionError
99
from llama_stack_client.types import VersionInfo
10+
from authentication.interface import AuthTuple
1011

1112
from configuration import AppConfig
1213
from app.endpoints.info import info_endpoint_handler
@@ -40,7 +41,7 @@ async def test_info_endpoint_returns_service_information(
4041
test_config: AppConfig,
4142
mock_llama_stack_client: AsyncMockType,
4243
test_request: Request,
43-
test_auth: tuple[str, str, bool, str],
44+
test_auth: AuthTuple,
4445
) -> None:
4546
"""Test that info endpoint returns correct service information.
4647
@@ -76,7 +77,7 @@ async def test_info_endpoint_handles_connection_error(
7677
test_config: AppConfig,
7778
mock_llama_stack_client: AsyncMockType,
7879
test_request: Request,
79-
test_auth: tuple[str, str, bool, str],
80+
test_auth: AuthTuple,
8081
mocker: MockerFixture,
8182
) -> None:
8283
"""Test that info endpoint properly handles Llama Stack connection errors.
@@ -116,7 +117,7 @@ async def test_info_endpoint_uses_configuration_values(
116117
test_config: AppConfig,
117118
mock_llama_stack_client: AsyncMockType,
118119
test_request: Request,
119-
test_auth: tuple[str, str, bool, str],
120+
test_auth: AuthTuple,
120121
) -> None:
121122
"""Test that info endpoint correctly uses configuration values.
122123

0 commit comments

Comments
 (0)