MCPcopy
hub / github.com/cli/cli / TestPendingOperationDisallowsForwardPorts

Function TestPendingOperationDisallowsForwardPorts

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

Source from the content-addressed store, hash-verified

115}
116
117func TestPendingOperationDisallowsForwardPorts(t *testing.T) {
118 app := testingPortsApp()
119 selector := &CodespaceSelector{api: app.apiClient, codespaceName: "disabledCodespace"}
120
121 if err := app.ForwardPorts(context.Background(), selector, nil); err != nil {
122 if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
123 t.Errorf("expected pending operation error, but got: %v", err)
124 }
125 } else {
126 t.Error("expected pending operation error, but got nothing")
127 }
128}
129
130func GetMockApi(allowOrgPorts bool) *apiClientMock {
131 return &apiClientMock{

Callers

nothing calls this directly

Calls 4

testingPortsAppFunction · 0.85
ForwardPortsMethod · 0.80
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected