Save local modifications for syncing
Some checks failed
CI / lint (push) Has been cancelled
CI / unit tests (push) Has been cancelled
CI / integration tests (push) Has been cancelled
CI / package build (push) Has been cancelled
Commit lint / pull request title (push) Has been cancelled
Commit lint / commit messages (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / unit tests (push) Has been cancelled
CI / integration tests (push) Has been cancelled
CI / package build (push) Has been cancelled
Commit lint / pull request title (push) Has been cancelled
Commit lint / commit messages (push) Has been cancelled
This commit is contained in:
@ -6,6 +6,7 @@ import pytest
|
||||
from pydantic import SecretStr
|
||||
|
||||
from everos.component.llm import build_llm_provider
|
||||
from everos.component.llm import factory as factory_mod
|
||||
from everos.component.llm.openai_provider import OpenAIProvider
|
||||
from everos.config.settings import LLMSettings
|
||||
|
||||
@ -26,3 +27,23 @@ def test_builds_openai_provider() -> None:
|
||||
s = LLMSettings(model="m", api_key=SecretStr("k"), base_url="https://x")
|
||||
p = build_llm_provider(s)
|
||||
assert isinstance(p, OpenAIProvider)
|
||||
|
||||
|
||||
def test_passes_configured_timeout(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
captured_kwargs = {}
|
||||
sentinel = object()
|
||||
|
||||
def capture_provider(**kwargs):
|
||||
captured_kwargs.update(kwargs)
|
||||
return sentinel
|
||||
|
||||
monkeypatch.setattr(factory_mod, "OpenAIProvider", capture_provider)
|
||||
s = LLMSettings(
|
||||
model="m",
|
||||
api_key=SecretStr("k"),
|
||||
base_url="https://x",
|
||||
timeout_seconds=240.0,
|
||||
)
|
||||
|
||||
assert build_llm_provider(s) is sentinel
|
||||
assert captured_kwargs["timeout"] == 240.0
|
||||
|
||||
Reference in New Issue
Block a user