(t *testing.T)
| 413 | } |
| 414 | |
| 415 | func 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 | |
| 440 | func TestGetRepoSuggestions(t *testing.T) { |
| 441 | tests := []struct { |
nothing calls this directly
no test coverage detected