MCPcopy
hub / github.com/cli/cli / TestPendingOperationDisallowsLogs

Function TestPendingOperationDisallowsLogs

pkg/cmd/codespace/logs_test.go:11–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestPendingOperationDisallowsLogs(t *testing.T) {
12 app := testingLogsApp()
13 selector := &CodespaceSelector{api: app.apiClient, codespaceName: "disabledCodespace"}
14
15 if err := app.Logs(context.Background(), selector, false); err != nil {
16 if err.Error() != "codespace is disabled while it has a pending operation: Some pending operation" {
17 t.Errorf("expected pending operation error, but got: %v", err)
18 }
19 } else {
20 t.Error("expected pending operation error, but got nothing")
21 }
22}
23
24func testingLogsApp() *App {
25 disabledCodespace := &api.Codespace{

Callers

nothing calls this directly

Calls 4

testingLogsAppFunction · 0.85
LogsMethod · 0.80
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected