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

Function TestMigrationService_UserMigrationStatus

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

Source from the content-addressed store, hash-verified

86}
87
88func TestMigrationService_UserMigrationStatus(t *testing.T) {
89 t.Parallel()
90 client, mux, _ := setup(t)
91
92 mux.HandleFunc("/user/migrations/1", func(w http.ResponseWriter, r *http.Request) {
93 testMethod(t, r, "GET")
94 testHeader(t, r, "Accept", mediaTypeMigrationsPreview)
95
96 w.WriteHeader(http.StatusOK)
97 assertWrite(t, w, userMigrationJSON)
98 })
99
100 ctx := t.Context()
101 got, _, err := client.Migrations.UserMigrationStatus(ctx, 1)
102 if err != nil {
103 t.Errorf("UserMigrationStatus returned error %v", err)
104 }
105
106 want := wantUserMigration
107 if !cmp.Equal(want, got) {
108 t.Errorf("UserMigrationStatus = %v, want = %v", got, want)
109 }
110
111 const methodName = "UserMigrationStatus"
112 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
113 got, resp, err := client.Migrations.UserMigrationStatus(ctx, 1)
114 if got != nil {
115 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
116 }
117 return resp, err
118 })
119}
120
121func TestMigrationService_UserMigrationArchiveURL(t *testing.T) {
122 t.Parallel()

Callers

nothing calls this directly

Calls 7

testMethodFunction · 0.85
testHeaderFunction · 0.85
assertWriteFunction · 0.85
UserMigrationStatusMethod · 0.80
EqualMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…