TestScreenOutbound_GateAction: a flagged recipient escalates to the agent's outbound_policy_action; open/allow produces ActionAllow.
(t *testing.T)
| 59 | // TestScreenOutbound_GateAction: a flagged recipient escalates to the agent's |
| 60 | // outbound_policy_action; open/allow produces ActionAllow. |
| 61 | func TestScreenOutbound_GateAction(t *testing.T) { |
| 62 | a := testScreenAPI() |
| 63 | req := outbound.SendRequest{To: []string{"x@elsewhere.com"}, Subject: "hi", Body: "hello"} |
| 64 | for _, action := range []string{"flag", "review", "block"} { |
| 65 | ag := &identity.AgentIdentity{ |
| 66 | Domain: "bot.example.com", ID: "bot@bot.example.com", |
| 67 | OutboundPolicy: identity.OutboundPolicyDomain, OutboundPolicyAction: action, |
| 68 | OutboundScan: identity.ScanOff, |
| 69 | } |
| 70 | v := a.screenOutbound(context.Background(), ag, req) |
| 71 | if string(v.Applied) != action { |
| 72 | t.Errorf("action=%s: applied=%q, want %q", action, v.Applied, action) |
| 73 | } |
| 74 | if v.ReviewReason != identity.ReviewReasonRecipientGate { |
| 75 | t.Errorf("action=%s: reason=%q, want recipient_gate", action, v.ReviewReason) |
| 76 | } |
| 77 | if v.GateAddr != "x@elsewhere.com" { |
| 78 | t.Errorf("action=%s: gate addr=%q", action, v.GateAddr) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestScreenOutbound_OpenAllowsBenign(t *testing.T) { |
| 84 | a := testScreenAPI() |
nothing calls this directly
no test coverage detected