e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
33 lines
955 B
Python
33 lines
955 B
Python
"""Tests for BaseAgent runtime binding behavior."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from deeptutor.agents.base_agent import BaseAgent
|
|
from deeptutor.services.llm.config import LLMConfig
|
|
|
|
|
|
class _DummyAgent(BaseAgent):
|
|
async def process(self, **_kwargs): # noqa: ANN003
|
|
return {}
|
|
|
|
|
|
def test_base_agent_defaults_to_resolved_binding(monkeypatch) -> None:
|
|
"""When binding is not explicitly provided, use resolved runtime binding."""
|
|
resolved = LLMConfig(
|
|
model="google/gemini-3-flash-preview",
|
|
api_key="sk-test",
|
|
base_url="https://openrouter.ai/api/v1",
|
|
binding="openrouter",
|
|
provider_name="openrouter",
|
|
provider_mode="gateway",
|
|
)
|
|
monkeypatch.setattr("deeptutor.agents.base_agent.get_llm_config", lambda: resolved)
|
|
|
|
agent = _DummyAgent(
|
|
module_name="question",
|
|
agent_name="idea_agent",
|
|
language="en",
|
|
)
|
|
|
|
assert agent.binding == "openrouter"
|