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

Function TestPendingOperationDisallowsForwardPorts

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

Source from the content-addressed store, hash-verified

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