(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func 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 | |
| 121 | func TestMigrationService_UserMigrationArchiveURL(t *testing.T) { |
| 122 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…