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

Function TestMigrationService_UnlockUserRepo

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

Source from the content-addressed store, hash-verified

180}
181
182func TestMigrationService_UnlockUserRepo(t *testing.T) {
183 t.Parallel()
184 client, mux, _ := setup(t)
185
186 mux.HandleFunc("/user/migrations/1/repos/r/lock", func(w http.ResponseWriter, r *http.Request) {
187 testMethod(t, r, "DELETE")
188 testHeader(t, r, "Accept", mediaTypeMigrationsPreview)
189
190 w.WriteHeader(http.StatusNoContent)
191 })
192
193 ctx := t.Context()
194 got, err := client.Migrations.UnlockUserRepo(ctx, 1, "r")
195 if err != nil {
196 t.Errorf("UnlockUserRepo returned error %v", err)
197 }
198
199 if got.StatusCode != http.StatusNoContent {
200 t.Errorf("UnlockUserRepo returned status = %v, want = %v", got.StatusCode, http.StatusNoContent)
201 }
202
203 const methodName = "UnlockUserRepo"
204 testBadOptions(t, methodName, func() (err error) {
205 _, err = client.Migrations.UnlockUserRepo(ctx, -1, "\n")
206 return err
207 })
208
209 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
210 return client.Migrations.UnlockUserRepo(ctx, 1, "r")
211 })
212}
213
214var userMigrationJSON = []byte(`{
215 "id": 79,

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…