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

Function TestGistsService_Delete

github/gists_test.go:723–746  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

721}
722
723func TestGistsService_Delete(t *testing.T) {
724 t.Parallel()
725 client, mux, _ := setup(t)
726
727 mux.HandleFunc("/gists/1", func(_ http.ResponseWriter, r *http.Request) {
728 testMethod(t, r, "DELETE")
729 })
730
731 ctx := t.Context()
732 _, err := client.Gists.Delete(ctx, "1")
733 if err != nil {
734 t.Errorf("Gists.Delete returned error: %v", err)
735 }
736
737 const methodName = "Delete"
738 testBadOptions(t, methodName, func() (err error) {
739 _, err = client.Gists.Delete(ctx, "\n")
740 return err
741 })
742
743 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
744 return client.Gists.Delete(ctx, "1")
745 })
746}
747
748func TestGistsService_Delete_invalidID(t *testing.T) {
749 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
setupFunction · 0.70
DeleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…