MCPcopy Create free account
hub / github.com/foxcpp/maddy / TestMsgPipeline_AllToTarget

Function TestMsgPipeline_AllToTarget

internal/msgpipeline/msgpipeline_test.go:34–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestMsgPipeline_AllToTarget(t *testing.T) {
35 target := testutils.Target{}
36 d := MsgPipeline{
37 msgpipelineCfg: msgpipelineCfg{
38 perSource: map[string]sourceBlock{},
39 defaultSource: sourceBlock{
40 perRcpt: map[string]*rcptBlock{},
41 defaultRcpt: &rcptBlock{
42 targets: []module.DeliveryTarget{&target},
43 },
44 },
45 },
46 Log: testutils.Logger(t, "msgpipeline"),
47 }
48
49 testutils.DoTestDelivery(t, &d, "sender@example.com", []string{"rcpt1@example.com", "rcpt2@example.com"})
50
51 if len(target.Messages) != 1 {
52 t.Fatalf("wrong amount of messages received, want %d, got %d", 1, len(target.Messages))
53 }
54
55 testutils.CheckTestMessage(t, &target, 0, "sender@example.com", []string{"rcpt1@example.com", "rcpt2@example.com"})
56}
57
58func TestMsgPipeline_PerSourceDomainSplit(t *testing.T) {
59 orgTarget, comTarget := testutils.Target{InstName: "orgTarget"}, testutils.Target{InstName: "comTarget"}

Callers

nothing calls this directly

Calls 3

LoggerFunction · 0.92
DoTestDeliveryFunction · 0.92
CheckTestMessageFunction · 0.92

Tested by

no test coverage detected