(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestOrganizationsService_IsBlocked(t *testing.T) { |
| 57 | t.Parallel() |
| 58 | client, mux, _ := setup(t) |
| 59 | |
| 60 | mux.HandleFunc("/orgs/o/blocks/u", func(w http.ResponseWriter, r *http.Request) { |
| 61 | testMethod(t, r, "GET") |
| 62 | testHeader(t, r, "Accept", mediaTypeBlockUsersPreview) |
| 63 | w.WriteHeader(http.StatusNoContent) |
| 64 | }) |
| 65 | |
| 66 | ctx := t.Context() |
| 67 | isBlocked, _, err := client.Organizations.IsBlocked(ctx, "o", "u") |
| 68 | if err != nil { |
| 69 | t.Errorf("Organizations.IsBlocked returned error: %v", err) |
| 70 | } |
| 71 | if want := true; isBlocked != want { |
| 72 | t.Errorf("Organizations.IsBlocked returned %+v, want %+v", isBlocked, want) |
| 73 | } |
| 74 | |
| 75 | const methodName = "IsBlocked" |
| 76 | testBadOptions(t, methodName, func() (err error) { |
| 77 | _, _, err = client.Organizations.IsBlocked(ctx, "\n", "\n") |
| 78 | return err |
| 79 | }) |
| 80 | |
| 81 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 82 | got, resp, err := client.Organizations.IsBlocked(ctx, "o", "u") |
| 83 | if got { |
| 84 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 85 | } |
| 86 | return resp, err |
| 87 | }) |
| 88 | } |
| 89 | |
| 90 | func TestOrganizationsService_BlockUser(t *testing.T) { |
| 91 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…