test(03-01): add Wave 0 xfail stubs and shared fixtures for Phase 3

- Add auth_user, admin_user, mock_minio_presigned, mock_minio_stat fixtures to conftest.py
- Create test_quota.py with 4 xfail stubs (STORE-03, STORE-05, STORE-06, SC2 race)
- Append test_migration_0003 to test_alembic.py (full pre-seed + post-migration assertions)
- Append 3 classifier xfail stubs (DOC-03, DOC-05, D-15)
- Append 6 document xfail stubs (D-05, STORE-04, SEC-04, D-16)
- Append 4 topic xfail stubs (DOC-04, D-09, D-17)
- Append test_settings_endpoint_removed stub (D-12)
- All 19 new test IDs collect cleanly with xfail(strict=False)
This commit is contained in:
curo1305
2026-05-23 13:42:37 +02:00
parent fdc32d431d
commit 21ec9cb4c3
7 changed files with 492 additions and 0 deletions
+38
View File
@@ -108,3 +108,41 @@ async def test_classifier_with_mock_provider(isolated_data_dir):
# Verify document was updated
meta = st.get_metadata(doc_id)
assert "Finance" in meta["topics"]
# ---------------------------------------------------------------------------
# Wave 0 xfail stubs for per-user AI provider resolution — Plan 03-04
# ---------------------------------------------------------------------------
@pytest.mark.xfail(strict=False, reason="implemented in plan 03-04")
async def test_per_user_provider(db_session):
"""When user.ai_provider='openai' and user.ai_model='gpt-4o', the classifier
resolves _settings['active_provider'] == 'openai'.
DOC-03: AI provider/model comes from the user's DB record, not from global
config or the retired load_settings() flat file (CONTEXT.md D-14).
"""
assert True # scaffold
@pytest.mark.xfail(strict=False, reason="implemented in plan 03-04")
async def test_celery_task_uses_user_provider(db_session):
"""Calling _run(document_id) for a Document owned by user.ai_provider='anthropic'
calls classifier with ai_provider='anthropic'.
DOC-05: the Celery extract_and_classify task resolves per-user AI config via
a second DB lookup (doc.user_id → user.ai_provider/ai_model) and passes it
to the classifier (CONTEXT.md D-14).
"""
assert True # scaffold
@pytest.mark.xfail(strict=False, reason="implemented in plan 03-04")
async def test_default_provider_fallback(db_session):
"""When user.ai_provider is None, the classifier receives config.settings.default_ai_provider.
D-15: fallback chain is user.ai_provider → DEFAULT_AI_PROVIDER env var →
code default 'ollama' (CONTEXT.md D-15).
"""
assert True # scaffold