MCPcopy Index your code
hub / github.com/cli/cli / TestListCodespaces_limited

Function TestListCodespaces_limited

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

Source from the content-addressed store, hash-verified

388}
389
390func TestListCodespaces_limited(t *testing.T) {
391 svr := createFakeListEndpointServer(t, 200, 200)
392 defer svr.Close()
393
394 api := API{
395 githubAPI: svr.URL,
396 client: createHttpClient,
397 }
398 ctx := context.TODO()
399 codespaces, err := api.ListCodespaces(ctx, ListCodespacesOptions{Limit: 200})
400 if err != nil {
401 t.Fatal(err)
402 }
403
404 if len(codespaces) != 200 {
405 t.Fatalf("expected 200 codespace, got %d", len(codespaces))
406 }
407 if codespaces[0].Name != "codespace-0" {
408 t.Fatalf("expected codespace-0, got %s", codespaces[0].Name)
409 }
410 if codespaces[199].Name != "codespace-199" {
411 t.Fatalf("expected codespace-199, got %s", codespaces[0].Name)
412 }
413}
414
415func TestListCodespaces_unlimited(t *testing.T) {
416 svr := createFakeListEndpointServer(t, 200, 200)

Callers

nothing calls this directly

Calls 3

ListCodespacesMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected