(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func 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 | |
| 182 | func TestMigrationService_UnlockUserRepo(t *testing.T) { |
| 183 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…