deerflow2/tests/unit/server
Willem Jiang fb319aaa44
test: add unit tests for global connection pool (Issue #778) (#780)
* test: add unit tests for global connection pool (Issue #778)

- Add TestLifespanFunction class with 9 tests for lifespan management:
  - PostgreSQL/MongoDB pool initialization success/failure
  - Cleanup on shutdown
  - Skip initialization when not configured

- Add TestGlobalConnectionPoolUsage class with 4 tests:
  - Using global pools when available
  - Fallback to per-request connections

- Fix missing dict_row import in app.py (bug from PR #757)

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 23:06:39 +08:00
..
test_app.py test: add unit tests for global connection pool (Issue #778) (#780) 2025-12-23 23:06:39 +08:00
test_chat_request.py feat: 1. replace black with ruff for fomatting and sort import (#489) 2025-08-17 22:57:23 +08:00
test_mcp_request.py feat: 1. replace black with ruff for fomatting and sort import (#489) 2025-08-17 22:57:23 +08:00
test_mcp_utils.py fix: env parameters exception when configuring SSE or HTTP MCP server (#513) 2025-08-20 17:23:57 +08:00
test_tool_call_chunks.py security: add log injection attack prevention with input sanitization (#667) 2025-10-27 20:57:23 +08:00