MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestScreenInbound_GateFlagDelivers

Function TestScreenInbound_GateFlagDelivers

internal/relay/screening_test.go:181–196  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestScreenInbound_GateFlagDelivers(t *testing.T) {
182 srv := testScreenServer()
183 agent := scanOnAgent()
184 agent.InboundScan = identity.ScanOff
185 agent.InboundPolicyAction = "flag" // default → deliver, never hold
186 res := srv.screenInbound(context.Background(), agent, "msg_h4", "stranger@x.com",
187 []byte("Subject: hi\r\n\r\nhi"), nil,
188 inboundpolicy.Decision{Flagged: true, Reason: "sender not on allowlist"})
189
190 if res.Hold {
191 t.Errorf("gate flag must not hold")
192 }
193 if res.Denorm.Status != "" {
194 t.Errorf("delivered message must have empty review status, got %q", res.Denorm.Status)
195 }
196}

Callers

nothing calls this directly

Calls 3

testScreenServerFunction · 0.85
scanOnAgentFunction · 0.85
screenInboundMethod · 0.80

Tested by

no test coverage detected