generated from coulomb/repo-seed
web UI side of change review
This commit is contained in:
@@ -841,6 +841,7 @@ def test_ui_register_analyze_and_approve_loop(tmp_path):
|
||||
)
|
||||
assert run_response.status_code == 303
|
||||
run_path = run_response.headers["location"]
|
||||
first_run_id = int(run_path.rsplit("/", 1)[-1])
|
||||
|
||||
run_detail = client.get(run_path)
|
||||
assert run_detail.status_code == 200
|
||||
@@ -865,6 +866,49 @@ def test_ui_register_analyze_and_approve_loop(tmp_path):
|
||||
assert "interface:app.py:3" in approved_detail.text
|
||||
assert "approve_candidate_graph" in approved_detail.text
|
||||
|
||||
(source / "app.py").write_text(
|
||||
"from fastapi import FastAPI\n"
|
||||
"app = FastAPI()\n"
|
||||
'@app.get("/status")\n'
|
||||
"def status():\n"
|
||||
" return {}\n\n"
|
||||
'@app.get("/ready")\n'
|
||||
"def ready():\n"
|
||||
" return {}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
second_run_response = client.post(
|
||||
f"{repository_path}/analysis-runs",
|
||||
data={"source_path": ""},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert second_run_response.status_code == 303
|
||||
second_run_path = second_run_response.headers["location"]
|
||||
|
||||
second_run_detail = client.get(second_run_path)
|
||||
assert second_run_detail.status_code == 200
|
||||
assert "Compare to #" in second_run_detail.text
|
||||
|
||||
second_run_id = int(second_run_path.rsplit("/", 1)[-1])
|
||||
diff_response = client.get(
|
||||
f"{repository_path}/analysis-runs/{first_run_id}/diff/{second_run_id}"
|
||||
)
|
||||
assert diff_response.status_code == 200
|
||||
assert "Change Review" in diff_response.text
|
||||
assert "Approved Registry Impact" in diff_response.text
|
||||
assert "Candidate Claims" in diff_response.text
|
||||
assert "GET /ready" in diff_response.text
|
||||
|
||||
change_approval = client.post(
|
||||
f"{second_run_path}/changes/approve",
|
||||
data={"notes": "Accept UI change review."},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert change_approval.status_code == 303
|
||||
changed_detail = client.get(change_approval.headers["location"])
|
||||
assert "GET /ready" in changed_detail.text
|
||||
assert "approve_analysis_run_changes" in changed_detail.text
|
||||
|
||||
search_response = client.get("/ui/search", params={"q": "repository"})
|
||||
assert search_response.status_code == 200
|
||||
assert "UI Repo" in search_response.text
|
||||
|
||||
Reference in New Issue
Block a user