MCPcopy Index your code
hub / github.com/cli/cli / TestListPorts

Function TestListPorts

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

Source from the content-addressed store, hash-verified

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

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