(t *testing.T)
| 231 | } |
| 232 | |
| 233 | func TestCodespacesService_Stop(t *testing.T) { |
| 234 | t.Parallel() |
| 235 | client, mux, _ := setup(t) |
| 236 | |
| 237 | mux.HandleFunc("/user/codespaces/codespace_1/stop", func(w http.ResponseWriter, r *http.Request) { |
| 238 | testMethod(t, r, "POST") |
| 239 | fmt.Fprint(w, `{"id":1, "repository": {"id": 1296269}}`) |
| 240 | }) |
| 241 | ctx := t.Context() |
| 242 | codespace, _, err := client.Codespaces.Stop(ctx, "codespace_1") |
| 243 | if err != nil { |
| 244 | t.Errorf("Codespaces.Stop returned error: %v", err) |
| 245 | } |
| 246 | want := &Codespace{ |
| 247 | ID: Ptr(int64(1)), |
| 248 | Repository: &Repository{ |
| 249 | ID: Ptr(int64(1296269)), |
| 250 | }, |
| 251 | } |
| 252 | |
| 253 | if !cmp.Equal(codespace, want) { |
| 254 | t.Errorf("Codespaces.Stop returned %+v, want %+v", codespace, want) |
| 255 | } |
| 256 | |
| 257 | const methodName = "Stop" |
| 258 | testBadOptions(t, methodName, func() (err error) { |
| 259 | _, _, err = client.Codespaces.Stop(ctx, "\n") |
| 260 | return err |
| 261 | }) |
| 262 | |
| 263 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 264 | got, resp, err := client.Codespaces.Stop(ctx, "o") |
| 265 | if got != nil { |
| 266 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 267 | } |
| 268 | return resp, err |
| 269 | }) |
| 270 | } |
| 271 | |
| 272 | func TestCodespacesService_Delete(t *testing.T) { |
| 273 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…