LightRAG/tests
BukeLy 510baebf62 fix: correct PostgreSQL execute() parameter format in workspace cleanup
Critical Bug Fix:
PostgreSQLDB.execute() expects data as dict, but workspace cleanup
was passing a list [workspace], causing cleanup to fail with
"PostgreSQLDB.execute() expects data as dict, got list" error.

Changes:
1. Fixed postgres_impl.py:2522
   - Changed: await db.execute(delete_query, [workspace])
   - To: await db.execute(delete_query, {"workspace": workspace})

2. Improved test_postgres_migration.py mock
   - Enhanced COUNT(*) mock to properly distinguish between:
     * Legacy table with workspace filter (returns 50)
     * Legacy table without filter after deletion (returns 0)
     * New table verification (returns 50)
   - Uses storage.legacy_table_name dynamically instead of hardcoded strings
   - Detects table type by checking for model suffix patterns

3. Fixed test_unified_lock_safety.py formatting
   - Applied ruff formatting to assert statement

Impact:
- Workspace-aware legacy cleanup now works correctly
- Legacy tables properly deleted when all workspace data migrated
- Legacy tables preserved when other workspace data remains

Tests: All 25 unit tests pass
2025-11-23 16:55:48 +08:00
..
conftest.py Add GitHub CI workflow and test markers for offline/integration tests 2025-11-18 11:36:10 +08:00
README_WORKSPACE_ISOLATION_TESTS.md Fix linting 2025-11-18 08:07:54 +08:00
test_aquery_data_endpoint.py Add GitHub CI workflow and test markers for offline/integration tests 2025-11-18 11:36:10 +08:00
test_base_storage_integrity.py style: fix lint errors (trailing whitespace and formatting) 2025-11-20 01:41:23 +08:00
test_curl_aquery_data.sh Fix linting 2025-10-06 04:57:11 +08:00
test_dimension_mismatch.py style: apply ruff formatting to test files 2025-11-23 16:45:50 +08:00
test_e2e_multi_instance.py style: apply ruff formatting to test files 2025-11-23 16:45:50 +08:00
test_embedding_func.py style: fix lint errors (trailing whitespace and formatting) 2025-11-20 01:41:23 +08:00
test_graph_storage.py Add GitHub CI workflow and test markers for offline/integration tests 2025-11-18 11:36:10 +08:00
test_lightrag_ollama_chat.py Rename test classes to prevent warning from pytest 2025-11-18 13:33:05 +08:00
test_no_model_suffix_safety.py style: apply ruff formatting to test files 2025-11-23 16:45:50 +08:00
test_postgres_migration.py fix: correct PostgreSQL execute() parameter format in workspace cleanup 2025-11-23 16:55:48 +08:00
test_postgres_retry_integration.py Add GitHub CI workflow and test markers for offline/integration tests 2025-11-18 11:36:10 +08:00
test_qdrant_migration.py feat: implement dimension compatibility checks for PostgreSQL and Qdrant migrations 2025-11-20 12:22:13 +08:00
test_unified_lock_safety.py fix: prevent double-release in UnifiedLock.__aexit__ error recovery 2025-11-23 16:34:08 +08:00
test_workspace_isolation.py Fix test to use default workspace parameter behavior 2025-11-18 11:51:17 +08:00
test_workspace_migration_isolation.py style: apply ruff formatting to test files 2025-11-23 16:45:50 +08:00
test_write_json_optimization.py Add GitHub CI workflow and test markers for offline/integration tests 2025-11-18 11:36:10 +08:00