(t *testing.T)
| 436 | } |
| 437 | |
| 438 | func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { |
| 439 | t.Parallel() |
| 440 | client, mux, _ := setup(t) |
| 441 | |
| 442 | installationTokenOptions := &InstallationTokenOptions{ |
| 443 | RepositoryIDs: []int64{1234}, |
| 444 | Repositories: []string{"foo"}, |
| 445 | Permissions: &InstallationPermissions{ |
| 446 | Contents: Ptr("write"), |
| 447 | Issues: Ptr("read"), |
| 448 | }, |
| 449 | } |
| 450 | |
| 451 | mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { |
| 452 | testMethod(t, r, "POST") |
| 453 | testJSONBody(t, r, installationTokenOptions) |
| 454 | fmt.Fprint(w, `{"token":"t"}`) |
| 455 | }) |
| 456 | |
| 457 | ctx := t.Context() |
| 458 | token, _, err := client.Apps.CreateInstallationToken(ctx, 1, installationTokenOptions) |
| 459 | if err != nil { |
| 460 | t.Errorf("Apps.CreateInstallationToken returned error: %v", err) |
| 461 | } |
| 462 | |
| 463 | want := &InstallationToken{Token: Ptr("t")} |
| 464 | if !cmp.Equal(token, want) { |
| 465 | t.Errorf("Apps.CreateInstallationToken returned %+v, want %+v", token, want) |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | func TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) { |
| 470 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…