test: close coverage gaps and add frontend test infrastructure
Backend (516 tests, 94% coverage): - Add azure_openai endpoint/deployment validation tests (config.py -> 100%) - Add _total_conversations and _avg_turns direct tests (queries.py -> 100%) - Add transformer edge cases: list content, string checkpoint, invalid JSON, malformed message graceful skip (transformer.py -> 93%) - Add safety combined status_code+error_message interaction tests - Fix ambiguous 200/422 assertion to strict 422 - Add E2E pagination shape assertions (total, page, per_page, row count) - Fix ReplayPool mock to respect LIMIT/OFFSET params Frontend (23 tests, vitest + happy-dom + @testing-library/react): - Add vitest infrastructure with happy-dom environment - Add api.ts tests: success, HTTP error, success=false, URL encoding - Add DashboardPage tests: loading, data, error, empty states - Add ReplayListPage tests: loading, empty, data, error, status badge classes - Add ReplayPage tests: loading, steps, empty, error states
This commit is contained in:
@@ -89,3 +89,21 @@ class TestSettings:
|
||||
anthropic_api_key="key",
|
||||
openai_api_key="",
|
||||
)
|
||||
|
||||
def test_azure_openai_missing_endpoint_rejected(self) -> None:
|
||||
with pytest.raises(ValueError, match="AZURE_OPENAI_ENDPOINT"):
|
||||
_isolated_settings(
|
||||
database_url="postgresql://x:x@localhost/db",
|
||||
llm_provider="azure_openai",
|
||||
azure_openai_api_key="key",
|
||||
azure_openai_deployment="my-deploy",
|
||||
)
|
||||
|
||||
def test_azure_openai_missing_deployment_rejected(self) -> None:
|
||||
with pytest.raises(ValueError, match="AZURE_OPENAI_DEPLOYMENT"):
|
||||
_isolated_settings(
|
||||
database_url="postgresql://x:x@localhost/db",
|
||||
llm_provider="azure_openai",
|
||||
azure_openai_api_key="key",
|
||||
azure_openai_endpoint="https://example.openai.azure.com",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user