chore: update gitignore; feat: 新增customer_agent业务模块与api路由
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
from rag.events import publish_knowledge_update
|
||||
|
||||
|
||||
class KnowledgeEventTests(unittest.IsolatedAsyncioTestCase):
|
||||
async def test_publishes_update_event_after_successful_ingestion(self):
|
||||
publisher = AsyncMock()
|
||||
|
||||
await publish_knowledge_update(
|
||||
publisher, doc_id="doc-1", collection_name="fin_faq", chunk_count=4
|
||||
)
|
||||
|
||||
publisher.assert_awaited_once_with(
|
||||
"event:knowledge_update",
|
||||
{"doc_id": "doc-1", "collection_name": "fin_faq", "chunk_count": 4},
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user