(t *testing.T, r *http.Request)
| 360 | } |
| 361 | |
| 362 | func checkCreatePluginVersionRequest(t *testing.T, r *http.Request) { |
| 363 | t.Helper() |
| 364 | |
| 365 | body, err := io.ReadAll(r.Body) |
| 366 | if err != nil { |
| 367 | t.Fatal(err) |
| 368 | } |
| 369 | got := map[string]any{} |
| 370 | err = json.Unmarshal(body, &got) |
| 371 | if err != nil { |
| 372 | t.Fatal(err) |
| 373 | } |
| 374 | want := map[string]any{ |
| 375 | "message": "## This is a subtitle\n\nThis is a paragraph.\n", |
| 376 | "package_type": "native", |
| 377 | "protocols": []any{float64(3)}, |
| 378 | "supported_targets": []any{ |
| 379 | "linux_amd64", "darwin_amd64", |
| 380 | }, |
| 381 | "checksums": []any{"1234567890", "1234567890"}, |
| 382 | } |
| 383 | if diff := cmp.Diff(want, got); diff != "" { |
| 384 | t.Fatalf("mismatch (-want +got):\n%s", diff) |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | func checkUpdatePluginVersionRequest(t *testing.T, r *http.Request) { |
| 389 | t.Helper() |
no outgoing calls
no test coverage detected