mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 23:46:50 +00:00
refactor(tests): reorganize tests into unittest/ and e2e/ directories
- Move all unit tests from tests/ to tests/unittest/ - Add tests/e2e/ directory for end-to-end tests - Update conftest.py for new test structure - Add new tests for auth dependencies, policies, route injection - Add new tests for run callbacks, create store, execution artifacts - Remove obsolete tests for deleted persistence layer Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
import pytest
|
||||
|
||||
from app.gateway.services.runs.store.create_store import AppRunCreateStore
|
||||
from deerflow.runtime.runs.types import RunRecord, RunStatus
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_create_run_syncs_thread_meta_assistant_id():
|
||||
repo = AsyncMock()
|
||||
thread_meta_storage = AsyncMock()
|
||||
thread_meta_storage.ensure_thread.return_value.assistant_id = None
|
||||
|
||||
store = AppRunCreateStore(repo, thread_meta_storage=thread_meta_storage)
|
||||
record = RunRecord(
|
||||
run_id="run-1",
|
||||
thread_id="thread-1",
|
||||
assistant_id="lead_agent",
|
||||
status=RunStatus.pending,
|
||||
temporary=False,
|
||||
multitask_strategy="reject",
|
||||
)
|
||||
|
||||
await store.create_run(record)
|
||||
|
||||
repo.create.assert_awaited_once()
|
||||
thread_meta_storage.ensure_thread.assert_awaited_once_with(
|
||||
thread_id="thread-1",
|
||||
assistant_id="lead_agent",
|
||||
)
|
||||
thread_meta_storage.sync_thread_assistant_id.assert_awaited_once_with(
|
||||
thread_id="thread-1",
|
||||
assistant_id="lead_agent",
|
||||
)
|
||||
Reference in New Issue
Block a user