MCPcopy
hub / github.com/cli/cli / TestCreateCodespaces_Pending

Function TestCreateCodespaces_Pending

internal/codespaces/api/api_test.go:363–388  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

361}
362
363func 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
390func TestListCodespaces_limited(t *testing.T) {
391 svr := createFakeListEndpointServer(t, 200, 200)

Callers

nothing calls this directly

Calls 3

CreateCodespaceMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected