fix: refactored manually
Some checks failed
validation / verify (push) Failing after 15s

This commit is contained in:
2026-09-02 16:08:12 +01:00
parent 43cbd215e2
commit b9a924cf4a
63 changed files with 1398 additions and 6 deletions

52
tests/test_agent_api.py Normal file
View File

@@ -0,0 +1,52 @@
"""Starlette REST API integration tests using TestClient."""
import pytest
from starlette.testclient import TestClient
from app.agent import app
@pytest.fixture
def client():
return TestClient(app)
def test_health_endpoint(client):
"""GET /health returns healthy status."""
response = client.get("/health")
assert response.status_code == 200
data = response.json()
assert data["status"] == "healthy"
assert "gcp_solution_architecture_agent" in data["agent"]
def test_card_endpoint(client):
"""GET /card returns agent capability card."""
response = client.get("/card")
assert response.status_code == 200
data = response.json()
assert data["name"] == "gcp_solution_architecture_agent"
assert "discover" in data["capabilities"]["phases"]
def test_generate_endpoint(client):
"""POST /generate executes full agent workflow."""
payload = {
"request": "Build an event-driven regional ingestion service",
"target_dir": ".",
}
response = client.post("/generate", json=payload)
assert response.status_code == 200
data = response.json()
assert data["status"] == "success"
assert data["validation_passed"] is True
assert "artifacts" in data
assert "solution_guide" in data["artifacts"]
def test_validate_endpoint(client):
"""POST /validate executes pre-deployment validation checks."""
payload = {"target_dir": "."}
response = client.post("/validate", json=payload)
assert response.status_code == 200
data = response.json()
assert data["valid"] is True