Skip to content

Commit 044bfd1

Browse files
committed
LCORE-974: proper types checked by Pydantic
1 parent 528738d commit 044bfd1

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/unit/models/config/test_tls_configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_tls_configuration_in_service_configuration() -> None:
3636
access_log=True,
3737
workers=10,
3838
auth_enabled=True,
39+
root_path="/",
3940
)
4041
assert cfg is not None
4142
assert cfg.tls_config is not None

tests/unit/models/responses/test_successful_responses.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Unit tests for all successful response models."""
44

55
import pytest
6-
from pydantic import AnyUrl, ValidationError, ConfigDict
6+
from pydantic import AnyUrl, AnyHttpUrl, ValidationError, ConfigDict
77
from pydantic_core import SchemaError
88

99
from models.config import (
@@ -955,9 +955,10 @@ def test_constructor(self) -> None:
955955
workers=10,
956956
color_log=True,
957957
access_log=True,
958+
root_path="/",
958959
),
959960
llama_stack=LlamaStackConfiguration(
960-
url="http://localhost:8321",
961+
url=AnyHttpUrl("http://localhost:8321"),
961962
use_as_library_client=False,
962963
api_key=None,
963964
library_client_config_path=None,

tests/unit/test_client.py

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

55
import json
66

7+
from pydantic import AnyHttpUrl
8+
79
import pytest
810
from client import AsyncLlamaStackClientHolder
911
from models.config import LlamaStackConfiguration
@@ -54,7 +56,7 @@ async def test_get_async_llama_stack_library_client() -> None:
5456
async def test_get_async_llama_stack_remote_client() -> None:
5557
"""Test the initialization of asynchronous Llama Stack client in server mode."""
5658
cfg = LlamaStackConfiguration(
57-
url="http://localhost:8321",
59+
url=AnyHttpUrl("http://localhost:8321"),
5860
api_key=None,
5961
use_as_library_client=False,
6062
library_client_config_path="./tests/configuration/minimal-stack.yaml",
@@ -90,7 +92,7 @@ async def test_get_async_llama_stack_wrong_configuration() -> None:
9092
async def test_update_provider_data_service_client() -> None:
9193
"""Test that update_provider_data updates headers for service clients."""
9294
cfg = LlamaStackConfiguration(
93-
url="http://localhost:8321",
95+
url=AnyHttpUrl("http://localhost:8321"),
9496
api_key=None,
9597
use_as_library_client=False,
9698
library_client_config_path=None,

0 commit comments

Comments
 (0)