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

Function TestListCodespaces_unlimited

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

Source from the content-addressed store, hash-verified

413}
414
415func TestListCodespaces_unlimited(t *testing.T) {
416 svr := createFakeListEndpointServer(t, 200, 200)
417 defer svr.Close()
418
419 api := API{
420 githubAPI: svr.URL,
421 client: createHttpClient,
422 }
423 ctx := context.TODO()
424 codespaces, err := api.ListCodespaces(ctx, ListCodespacesOptions{})
425 if err != nil {
426 t.Fatal(err)
427 }
428
429 if len(codespaces) != 250 {
430 t.Fatalf("expected 250 codespace, got %d", len(codespaces))
431 }
432 if codespaces[0].Name != "codespace-0" {
433 t.Fatalf("expected codespace-0, got %s", codespaces[0].Name)
434 }
435 if codespaces[249].Name != "codespace-249" {
436 t.Fatalf("expected codespace-249, got %s", codespaces[0].Name)
437 }
438}
439
440func TestGetRepoSuggestions(t *testing.T) {
441 tests := []struct {

Callers

nothing calls this directly

Calls 3

ListCodespacesMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected