MCPcopy Index your code
hub / github.com/google/go-github / TestMigrationService_DeleteUserMigration

Function TestMigrationService_DeleteUserMigration

github/migrations_user_test.go:150–180  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestMigrationService_DeleteUserMigration(t *testing.T) {
151 t.Parallel()
152 client, mux, _ := setup(t)
153
154 mux.HandleFunc("/user/migrations/1/archive", func(w http.ResponseWriter, r *http.Request) {
155 testMethod(t, r, "DELETE")
156 testHeader(t, r, "Accept", mediaTypeMigrationsPreview)
157
158 w.WriteHeader(http.StatusNoContent)
159 })
160
161 ctx := t.Context()
162 got, err := client.Migrations.DeleteUserMigration(ctx, 1)
163 if err != nil {
164 t.Errorf("DeleteUserMigration returned error %v", err)
165 }
166
167 if got.StatusCode != http.StatusNoContent {
168 t.Errorf("DeleteUserMigration returned status = %v, want = %v", got.StatusCode, http.StatusNoContent)
169 }
170
171 const methodName = "DeleteUserMigration"
172 testBadOptions(t, methodName, func() (err error) {
173 _, err = client.Migrations.DeleteUserMigration(ctx, -1)
174 return err
175 })
176
177 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
178 return client.Migrations.DeleteUserMigration(ctx, 1)
179 })
180}
181
182func TestMigrationService_UnlockUserRepo(t *testing.T) {
183 t.Parallel()

Callers

nothing calls this directly

Calls 6

testMethodFunction · 0.85
testHeaderFunction · 0.85
testBadOptionsFunction · 0.85
DeleteUserMigrationMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…