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

Function TestPendingOperationDisallowsForwardPorts

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

Source from the content-addressed store, hash-verified

150}
151
152func TestPendingOperationDisallowsForwardPorts(t *testing.T) {
153 app := testingPortsApp()
154 selector := &CodespaceSelector{api: app.apiClient, codespaceName: "disabledCodespace"}
155
156 if err := app.ForwardPorts(context.Background(), selector, nil, false); err != nil {
157 if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
158 t.Errorf("expected pending operation error, but got: %v", err)
159 }
160 } else {
161 t.Error("expected pending operation error, but got nothing")
162 }
163}
164
165func GetMockApi(allowOrgPorts bool) *apiClientMock {
166 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