M16: isolate acceptance and harden readiness
This commit is contained in:
@@ -148,9 +148,7 @@ def test_merge_customers_s2_scenario_rewires_and_audits(ops_client):
|
||||
issue = ops_client.get("/api/v1/data-quality/issues/DQ-DEMO-DUPLICATE").json()
|
||||
assert issue["status"] == "resolved"
|
||||
|
||||
audit_events = ops_client.get(
|
||||
"/api/v1/audit", params={"action": "customer_merged"}
|
||||
).json()
|
||||
audit_events = ops_client.get("/api/v1/audit", params={"action": "customer_merged"}).json()
|
||||
assert len(audit_events) >= 1
|
||||
|
||||
# Already-resolved issue cannot be merged again.
|
||||
@@ -431,9 +429,7 @@ def test_manual_scan_records_audit_event(ops_client):
|
||||
scan = ops_client.post("/api/v1/data-quality/scan")
|
||||
assert scan.status_code == 200
|
||||
|
||||
events = ops_client.get(
|
||||
"/api/v1/audit", params={"action": "data_quality_scan_run"}
|
||||
).json()
|
||||
events = ops_client.get("/api/v1/audit", params={"action": "data_quality_scan_run"}).json()
|
||||
assert len(events) >= 1
|
||||
assert "created" in events[0]["metadata"]
|
||||
|
||||
@@ -444,9 +440,7 @@ def _reset_demo(ops_client) -> None:
|
||||
# in before making any further authenticated call with the same client.
|
||||
response = ops_client.post("/api/v1/demo/reset")
|
||||
assert response.status_code == 200, response.text
|
||||
login_response = ops_client.post(
|
||||
"/api/v1/demo/login", json={"role": "operations_manager"}
|
||||
)
|
||||
login_response = ops_client.post("/api/v1/demo/login", json={"role": "operations_manager"})
|
||||
assert login_response.status_code == 200, login_response.text
|
||||
|
||||
|
||||
@@ -548,3 +542,11 @@ def test_rejected_issue_recurrence_links_to_prior_decision(ops_client):
|
||||
)
|
||||
assert match is not None, "expected a new issue linked back to the rejected one"
|
||||
assert match["evidence"]["previous_decision"] == "rejected"
|
||||
|
||||
|
||||
def test_scan_public_refs_are_collision_resistant() -> None:
|
||||
from app.services.data_quality import _new_scan_ref
|
||||
|
||||
refs = {_new_scan_ref("DQ-SCAN") for _ in range(1000)}
|
||||
assert len(refs) == 1000
|
||||
assert all(ref.startswith("DQ-SCAN-") and len(ref) == 18 for ref in refs)
|
||||
|
||||
Reference in New Issue
Block a user