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

Function TestAPI_EditCodespacePendingOperation

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

Source from the content-addressed store, hash-verified

778}
779
780func TestAPI_EditCodespacePendingOperation(t *testing.T) {
781 svr := createFakeEditPendingOpServer()
782 defer svr.Close()
783
784 a := &API{
785 client: createHttpClient,
786 githubAPI: svr.URL,
787 }
788
789 _, err := a.EditCodespace(context.Background(), "disabledCodespace", &EditCodespaceParams{DisplayName: "some silly name"})
790 if err == nil {
791 t.Error("Expected pending operation error, but got nothing")
792 }
793 if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
794 t.Errorf("Expected pending operation error, but got %v", err)
795 }
796}

Callers

nothing calls this directly

Calls 5

EditCodespaceMethod · 0.95
CloseMethod · 0.65
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected