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

Function TestGistsService_Unstar

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

Source from the content-addressed store, hash-verified

789}
790
791func TestGistsService_Unstar(t *testing.T) {
792 t.Parallel()
793 client, mux, _ := setup(t)
794
795 mux.HandleFunc("/gists/1/star", func(_ http.ResponseWriter, r *http.Request) {
796 testMethod(t, r, "DELETE")
797 })
798
799 ctx := t.Context()
800 _, err := client.Gists.Unstar(ctx, "1")
801 if err != nil {
802 t.Errorf("Gists.Unstar returned error: %v", err)
803 }
804
805 const methodName = "Unstar"
806 testBadOptions(t, methodName, func() (err error) {
807 _, err = client.Gists.Unstar(ctx, "\n")
808 return err
809 })
810
811 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
812 return client.Gists.Unstar(ctx, "1")
813 })
814}
815
816func TestGistsService_Unstar_invalidID(t *testing.T) {
817 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
setupFunction · 0.70
UnstarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…