MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / assertTestServerRequest

Function assertTestServerRequest

backend/pkg/httpserver/server_test.go:1354–1375  ·  view source on GitHub ↗
(t *testing.T, testServer *Server, req *http.Request, expectedResponse *http.Response,
	options ...testServerOption)

Source from the content-addressed store, hash-verified

1352
1353 return out
1354 })
1355}
1356
1357//nolint:ireturn
1358func getUpdateNotificationChannelRequestCmpOption() cmp.Option {
1359 return cmp.Transformer("NotificationChannelUpdateConfig",
1360 func(in *backend.UpdateNotificationChannelRequest_Config) map[string]any {
1361 if in == nil {
1362 return nil
1363 }
1364 var out map[string]any
1365 b, _ := in.MarshalJSON()
1366 _ = json.Unmarshal(b, &out)
1367
1368 return out
1369 })
1370}
1371
1372func newTestNotificationChannelConfig(t *testing.T, config any) backend.NotificationChannelResponse_Config {
1373 t.Helper()
1374
1375 var c backend.NotificationChannelResponse_Config
1376
1377 bytes, err := json.Marshal(config)
1378 if err != nil {

Calls 4

assertHeadersFunction · 0.85
assertStatusCodeFunction · 0.70
assertResponseBodyFunction · 0.70

Tested by

no test coverage detected