MCPcopy Create free account
hub / github.com/cli/cli / TestPendingOperationDisallowsListPorts

Function TestPendingOperationDisallowsListPorts

pkg/cmd/codespace/ports_test.go:91–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestPendingOperationDisallowsListPorts(t *testing.T) {
92 app := testingPortsApp()
93 selector := &CodespaceSelector{api: app.apiClient, codespaceName: "disabledCodespace"}
94
95 if err := app.ListPorts(context.Background(), selector, nil); err != nil {
96 if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
97 t.Errorf("expected pending operation error, but got: %v", err)
98 }
99 } else {
100 t.Error("expected pending operation error, but got nothing")
101 }
102}
103
104func TestPendingOperationDisallowsUpdatePortVisibility(t *testing.T) {
105 app := testingPortsApp()

Callers

nothing calls this directly

Calls 4

testingPortsAppFunction · 0.85
ListPortsMethod · 0.65
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected