MCPcopy
hub / github.com/cli/cli / apiClientMock

Struct apiClientMock

pkg/cmd/codespace/mock_api.go:80–306  ·  view source on GitHub ↗

apiClientMock is a mock implementation of apiClient. func TestSomethingThatUsesapiClient(t *testing.T) { // make and configure a mocked apiClient mockedapiClient := &apiClientMock{ CreateCodespaceFunc: func(ctx context.Context, params *codespacesAPI.CreateCodespaceParams) (*codespacesAPI.C

Source from the content-addressed store, hash-verified

78//
79// }
80type apiClientMock struct {
81 // CreateCodespaceFunc mocks the CreateCodespace method.
82 CreateCodespaceFunc func(ctx context.Context, params *codespacesAPI.CreateCodespaceParams) (*codespacesAPI.Codespace, error)
83
84 // DeleteCodespaceFunc mocks the DeleteCodespace method.
85 DeleteCodespaceFunc func(ctx context.Context, name string, orgName string, userName string) error
86
87 // EditCodespaceFunc mocks the EditCodespace method.
88 EditCodespaceFunc func(ctx context.Context, codespaceName string, params *codespacesAPI.EditCodespaceParams) (*codespacesAPI.Codespace, error)
89
90 // ExternalHTTPClientFunc mocks the ExternalHTTPClient method.
91 ExternalHTTPClientFunc func() (*http.Client, error)
92
93 // GetCodespaceFunc mocks the GetCodespace method.
94 GetCodespaceFunc func(ctx context.Context, name string, includeConnection bool) (*codespacesAPI.Codespace, error)
95
96 // GetCodespaceBillableOwnerFunc mocks the GetCodespaceBillableOwner method.
97 GetCodespaceBillableOwnerFunc func(ctx context.Context, nwo string) (*codespacesAPI.User, error)
98
99 // GetCodespaceRepoSuggestionsFunc mocks the GetCodespaceRepoSuggestions method.
100 GetCodespaceRepoSuggestionsFunc func(ctx context.Context, partialSearch string, params codespacesAPI.RepoSearchParameters) ([]string, error)
101
102 // GetCodespaceRepositoryContentsFunc mocks the GetCodespaceRepositoryContents method.
103 GetCodespaceRepositoryContentsFunc func(ctx context.Context, codespace *codespacesAPI.Codespace, path string) ([]byte, error)
104
105 // GetCodespacesMachinesFunc mocks the GetCodespacesMachines method.
106 GetCodespacesMachinesFunc func(ctx context.Context, repoID int, branch string, location string, devcontainerPath string) ([]*codespacesAPI.Machine, error)
107
108 // GetCodespacesPermissionsCheckFunc mocks the GetCodespacesPermissionsCheck method.
109 GetCodespacesPermissionsCheckFunc func(ctx context.Context, repoID int, branch string, devcontainerPath string) (bool, error)
110
111 // GetOrgMemberCodespaceFunc mocks the GetOrgMemberCodespace method.
112 GetOrgMemberCodespaceFunc func(ctx context.Context, orgName string, userName string, codespaceName string) (*codespacesAPI.Codespace, error)
113
114 // GetRepositoryFunc mocks the GetRepository method.
115 GetRepositoryFunc func(ctx context.Context, nwo string) (*codespacesAPI.Repository, error)
116
117 // GetUserFunc mocks the GetUser method.
118 GetUserFunc func(ctx context.Context) (*codespacesAPI.User, error)
119
120 // ListCodespacesFunc mocks the ListCodespaces method.
121 ListCodespacesFunc func(ctx context.Context, opts codespacesAPI.ListCodespacesOptions) ([]*codespacesAPI.Codespace, error)
122
123 // ListDevContainersFunc mocks the ListDevContainers method.
124 ListDevContainersFunc func(ctx context.Context, repoID int, branch string, limit int) ([]codespacesAPI.DevContainerEntry, error)
125
126 // ServerURLFunc mocks the ServerURL method.
127 ServerURLFunc func() string
128
129 // StartCodespaceFunc mocks the StartCodespace method.
130 StartCodespaceFunc func(ctx context.Context, name string) error
131
132 // StopCodespaceFunc mocks the StopCodespace method.
133 StopCodespaceFunc func(ctx context.Context, name string, orgName string, userName string) error
134
135 // calls tracks calls to the methods.
136 calls struct {
137 // CreateCodespace holds details about calls to the CreateCodespace method.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected