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

Function TestListPorts

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

Source from the content-addressed store, hash-verified

14)
15
16func TestListPorts(t *testing.T) {
17 ctx := t.Context()
18
19 mockApi := GetMockApi(false)
20 ios, _, _, _ := iostreams.Test()
21
22 a := &App{
23 io: ios,
24 apiClient: mockApi,
25 }
26
27 selector := &CodespaceSelector{api: a.apiClient, codespaceName: "codespace-name"}
28 err := a.ListPorts(ctx, selector, nil)
29 if err != nil {
30 t.Errorf("unexpected error: %v", err)
31 }
32}
33
34func TestListPorts_escapesControlSequencesInLabel(t *testing.T) {
35 tests := []struct {

Callers

nothing calls this directly

Calls 4

ListPortsMethod · 0.95
TestFunction · 0.92
GetMockApiFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected