Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/unit/test_gate_egress.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ async def test_request_enrichment_fails_closed_without_gate_url(monkeypatch: pyt
fake = _FakeClient(response=_response_packet())
monkeypatch.setattr(gate_egress, "get_gate_client", lambda: fake)
result = await request_enrichment(tenant="acme", entity_id="ent-1", domain="plasticos", target_fields=["polymer"])
assert result == {"status": "failed", "error": "gate_not_configured", "action": "enrich"}
assert result == {
"status": "failed",
"error": "gate_not_configured",
"action": "enrich",
"idempotency_key": enrichment_idempotency_key("acme", "ent-1", ["polymer"]),
}
assert fake.calls == [], "no direct fallback: nothing may be sent when Gate is not configured"


Expand Down Expand Up @@ -114,6 +119,7 @@ async def test_request_enrichment_reports_sdk_errors_as_failure(monkeypatch: pyt
result = await request_enrichment(tenant="acme", entity_id="ent-1", domain="plasticos", target_fields=["polymer"])
assert result["status"] == "failed"
assert result["error"] == "GateConnectionError"
assert result["idempotency_key"] == enrichment_idempotency_key("acme", "ent-1", ["polymer"])
assert len(fake.calls) == 1


Expand Down
Loading