mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-20 23:45:22 +08:00
test: align processor fixtures with current creation and startup behavior
This commit is contained in:
@@ -929,7 +929,7 @@ class TestPostgreSQLTenantRuntime:
|
||||
description='',
|
||||
adapter='capacity-probe',
|
||||
adapter_config={},
|
||||
enable=False,
|
||||
enable=True,
|
||||
event_bindings=[],
|
||||
),
|
||||
persistence_pipeline.LegacyPipeline(
|
||||
|
||||
@@ -27,6 +27,7 @@ from langbot.pkg.agent.runner.host_models import AgentBinding, AgentEventEnvelop
|
||||
from langbot.pkg.agent.runner.orchestrator import AgentRunOrchestrator
|
||||
from langbot.pkg.agent.runner.persistent_state_store import reset_persistent_state_store
|
||||
from langbot.pkg.agent.runner.session_registry import get_session_registry
|
||||
from langbot.pkg.api.http.service.model import LLMModelsService
|
||||
from langbot.pkg.api.http.context import (
|
||||
ExecutionContext,
|
||||
PrincipalContext,
|
||||
@@ -151,6 +152,7 @@ async def harness():
|
||||
runner_registry=ScopedRunnerRegistry(),
|
||||
)
|
||||
ap.plugin_connector = PromptPullConnector(ap)
|
||||
ap.llm_model_service = LLMModelsService(ap)
|
||||
ap.agent_run_orchestrator = AgentRunOrchestrator(ap, ap.runner_registry)
|
||||
ap.agent_service = AgentService(ap)
|
||||
try:
|
||||
@@ -315,4 +317,4 @@ async def test_non_debug_query_keeps_effective_prompt_instead_of_static_config(h
|
||||
assert query.prompt is original
|
||||
assert pulled == [message.model_dump(mode='json') for message in original.messages]
|
||||
else:
|
||||
assert pulled == []
|
||||
assert pulled == [Message(**message).model_dump(mode='json') for message in DEFAULT_PROMPT]
|
||||
|
||||
@@ -13,6 +13,7 @@ from langbot.pkg.api.http.service.agent import (
|
||||
PIPELINE_EVENT_PATTERNS,
|
||||
AgentService,
|
||||
)
|
||||
from langbot.pkg.api.http.service.model import LLMModelsService
|
||||
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
@@ -82,6 +83,7 @@ def _compiled_update_values(statement):
|
||||
|
||||
def _make_app():
|
||||
app = SimpleNamespace()
|
||||
app.llm_model_service = LLMModelsService(app)
|
||||
app.persistence_mgr = SimpleNamespace(
|
||||
execute_async=AsyncMock(),
|
||||
serialize_model=Mock(side_effect=_serialize_agent),
|
||||
@@ -877,7 +879,9 @@ async def test_event_processor_rejects_invalid_component_and_missing_parameters(
|
||||
)
|
||||
)
|
||||
with pytest.raises(ValueError, match='Required processor parameter'):
|
||||
await service.create_agent(WORKSPACE_UUID, {'kind': 'event_processor', 'component_ref': 'plugin:a/b/c'})
|
||||
await service.create_agent(
|
||||
WORKSPACE_UUID, {'kind': 'event_processor', 'component_ref': 'plugin:a/b/c', 'parameters': {}}
|
||||
)
|
||||
|
||||
|
||||
async def test_unavailable_event_processor_can_still_be_renamed():
|
||||
|
||||
Reference in New Issue
Block a user