feat: apply rel-001 feedback cleanup

This commit is contained in:
2026-06-05 13:57:46 +09:00
parent 84de34c301
commit 2470c0a00c
28 changed files with 992 additions and 32 deletions
+25
View File
@@ -18,6 +18,31 @@ def test_healthcheck() -> None:
assert body["service"] == "portfolio-hub"
assert "version" in body
assert "checked_at" in body
assert "db_enabled" in body
assert isinstance(body["db_enabled"], bool)
def test_health_exposes_db_enabled_true(monkeypatch) -> None:
"""REQ-035 AC-1: PORTFOLIOHUB_DB_ENABLED=true → db_enabled: true."""
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "true")
monkeypatch.setenv("CREDENTIAL_ENCRYPTION_KEY", "test-key-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")
get_settings.cache_clear()
client = TestClient(create_app())
response = client.get("/health")
get_settings.cache_clear()
assert response.status_code == 200
assert response.json()["db_enabled"] is True
def test_health_exposes_db_enabled_false(monkeypatch) -> None:
"""REQ-035 AC-2: PORTFOLIOHUB_DB_ENABLED=false → db_enabled: false."""
monkeypatch.setenv("PORTFOLIOHUB_DB_ENABLED", "false")
get_settings.cache_clear()
client = TestClient(create_app())
response = client.get("/health")
get_settings.cache_clear()
assert response.status_code == 200
assert response.json()["db_enabled"] is False
def test_docs_are_exposed() -> None: