import pytest DESIGN_DIR = "/workspace/arch-design-agent-skill-dashboard/design" @pytest.fixture def project_id(client): r = client.post("/api/projects", json={"name": "test", "design_dir": DESIGN_DIR}) return r.json()["id"] def test_get_file(client, project_id): r = client.get(f"/api/projects/{project_id}/files/business-architecture/02-capability-map.csv") assert r.status_code == 200 data = r.json() assert data["format"] == "csv" assert "content" in data def test_get_file_not_found(client, project_id): r = client.get(f"/api/projects/{project_id}/files/nonexistent.csv") assert r.status_code == 500 # FileSystemError def test_get_impact(client, project_id): # Trigger scan first client.post(f"/api/projects/{project_id}/scan") r = client.get(f"/api/projects/{project_id}/files/business-architecture/01-scope-and-goals.md/impact") assert r.status_code == 200 data = r.json() assert "source_file" in data assert "affected_files" in data