MCPcopy
hub / github.com/cli/cli / TestCreateCodespaces_displayName

Function TestCreateCodespaces_displayName

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

Source from the content-addressed store, hash-verified

336}
337
338func TestCreateCodespaces_displayName(t *testing.T) {
339 svr := createFakeCreateEndpointServer(t, http.StatusCreated)
340 defer svr.Close()
341
342 api := API{
343 githubAPI: svr.URL,
344 client: createHttpClient,
345 }
346
347 retentionPeriod := 0
348 codespace, err := api.CreateCodespace(context.Background(), &CreateCodespaceParams{
349 RepositoryID: 1,
350 IdleTimeoutMinutes: 10,
351 RetentionPeriodMinutes: &retentionPeriod,
352 DisplayName: "clucky cuckoo",
353 })
354 if err != nil {
355 t.Fatal(err)
356 }
357
358 if codespace.DisplayName != "clucky cuckoo" {
359 t.Fatalf("expected display name %q, got %q", "clucky cuckoo", codespace.DisplayName)
360 }
361}
362
363func TestCreateCodespaces_Pending(t *testing.T) {
364 svr := createFakeCreateEndpointServer(t, http.StatusAccepted)

Callers

nothing calls this directly

Calls 3

CreateCodespaceMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected