MCPcopy
hub / github.com/cli/cli / TestSelectWithCodespaceName

Function TestSelectWithCodespaceName

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

Source from the content-addressed store, hash-verified

9)
10
11func TestSelectWithCodespaceName(t *testing.T) {
12 wantName := "mock-codespace"
13
14 api := &apiClientMock{
15 GetCodespaceFunc: func(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) {
16 if name != wantName {
17 t.Errorf("incorrect name: want %s, got %s", wantName, name)
18 }
19
20 return &api.Codespace{}, nil
21 },
22 }
23
24 cs := &CodespaceSelector{api: api, codespaceName: wantName}
25
26 _, err := cs.Select(context.Background())
27
28 if err != nil {
29 t.Errorf("unexpected error: %v", err)
30 }
31}
32
33func TestSelectNameWithCodespaceName(t *testing.T) {
34 wantName := "mock-codespace"

Callers

nothing calls this directly

Calls 2

SelectMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected