MCPcopy
hub / github.com/kopia/kopia / TestWebhook_InvalidMethod

Function TestWebhook_InvalidMethod

notification/sender/webhook/webhook_sender_test.go:133–146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func TestWebhook_InvalidMethod(t *testing.T) {
134 ctx := testlogging.Context(t)
135 p, err := sender.GetSender(ctx, "my-profile", "webhook", &webhook.Options{
136 Endpoint: "http://localhost:41123/no-such-path",
137 Method: "?",
138 })
139
140 require.NoError(t, err)
141
142 require.ErrorContains(t, p.Send(ctx, &sender.Message{
143 Subject: "Test",
144 Body: "test",
145 }), "net/http: invalid method \"?\"")
146}
147
148func TestMergeOptions(t *testing.T) {
149 var dst webhook.Options

Callers

nothing calls this directly

Calls 3

ContextFunction · 0.92
GetSenderFunction · 0.92
SendMethod · 0.65

Tested by

no test coverage detected