MCPcopy Create free account
hub / github.com/google/go-github / TestOrganizationsService_CancelInvite

Function TestOrganizationsService_CancelInvite

github/orgs_members_test.go:285–309  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

283}
284
285func TestOrganizationsService_CancelInvite(t *testing.T) {
286 t.Parallel()
287 client, mux, _ := setup(t)
288
289 mux.HandleFunc("/orgs/o/invitations/1", func(w http.ResponseWriter, r *http.Request) {
290 testMethod(t, r, "DELETE")
291 w.WriteHeader(http.StatusNoContent)
292 })
293
294 ctx := t.Context()
295 _, err := client.Organizations.CancelInvite(ctx, "o", 1)
296 if err != nil {
297 t.Errorf("Organizations.CancelInvite returned error: %v", err)
298 }
299
300 const methodName = "CancelInvite"
301 testBadOptions(t, methodName, func() (err error) {
302 _, err = client.Organizations.CancelInvite(ctx, "\n", 1)
303 return err
304 })
305
306 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
307 return client.Organizations.CancelInvite(ctx, "o", 1)
308 })
309}
310
311func TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) {
312 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
CancelInviteMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…