(t *testing.T)
| 361 | } |
| 362 | |
| 363 | func TestCreateCodespaces_Pending(t *testing.T) { |
| 364 | svr := createFakeCreateEndpointServer(t, http.StatusAccepted) |
| 365 | defer svr.Close() |
| 366 | |
| 367 | api := API{ |
| 368 | githubAPI: svr.URL, |
| 369 | client: createHttpClient, |
| 370 | retryBackoff: 0, |
| 371 | } |
| 372 | |
| 373 | ctx := context.TODO() |
| 374 | retentionPeriod := 0 |
| 375 | params := &CreateCodespaceParams{ |
| 376 | RepositoryID: 1, |
| 377 | IdleTimeoutMinutes: 10, |
| 378 | RetentionPeriodMinutes: &retentionPeriod, |
| 379 | } |
| 380 | codespace, err := api.CreateCodespace(ctx, params) |
| 381 | if err != nil { |
| 382 | t.Fatal(err) |
| 383 | } |
| 384 | |
| 385 | if codespace.Name != "codespace-1" { |
| 386 | t.Fatalf("expected codespace-1, got %s", codespace.Name) |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | func TestListCodespaces_limited(t *testing.T) { |
| 391 | svr := createFakeListEndpointServer(t, 200, 200) |
nothing calls this directly
no test coverage detected