Ensure that a 400 response is interpreted as an actual error, and not simply as "false" like the above case of a 404.
(t *testing.T)
| 147 | // Ensure that a 400 response is interpreted as an actual error, and not simply |
| 148 | // as "false" like the above case of a 404. |
| 149 | func TestOrganizationsService_IsMember_error(t *testing.T) { |
| 150 | t.Parallel() |
| 151 | client, mux, _ := setup(t) |
| 152 | |
| 153 | mux.HandleFunc("/orgs/o/members/u", func(w http.ResponseWriter, r *http.Request) { |
| 154 | testMethod(t, r, "GET") |
| 155 | http.Error(w, "BadRequest", http.StatusBadRequest) |
| 156 | }) |
| 157 | |
| 158 | ctx := t.Context() |
| 159 | member, _, err := client.Organizations.IsMember(ctx, "o", "u") |
| 160 | if err == nil { |
| 161 | t.Error("Expected HTTP 400 response") |
| 162 | } |
| 163 | if want := false; member != want { |
| 164 | t.Errorf("Organizations.IsMember returned %+v, want %+v", member, want) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestOrganizationsService_IsMember_invalidOrg(t *testing.T) { |
| 169 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…