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

Struct CapiClientMock

pkg/cmd/agent-task/capi/client_mock.go:48–151  ·  view source on GitHub ↗

CapiClientMock is a mock implementation of CapiClient. func TestSomethingThatUsesCapiClient(t *testing.T) { // make and configure a mocked CapiClient mockedCapiClient := &CapiClientMock{ CreateJobFunc: func(ctx context.Context, owner string, repo string, problemStatement string, baseBranch

Source from the content-addressed store, hash-verified

46//
47// }
48type CapiClientMock struct {
49 // CreateJobFunc mocks the CreateJob method.
50 CreateJobFunc func(ctx context.Context, owner string, repo string, problemStatement string, baseBranch string, customAgent string) (*Job, error)
51
52 // GetJobFunc mocks the GetJob method.
53 GetJobFunc func(ctx context.Context, owner string, repo string, jobID string) (*Job, error)
54
55 // GetPullRequestDatabaseIDFunc mocks the GetPullRequestDatabaseID method.
56 GetPullRequestDatabaseIDFunc func(ctx context.Context, hostname string, owner string, repo string, number int) (int64, string, error)
57
58 // GetSessionFunc mocks the GetSession method.
59 GetSessionFunc func(ctx context.Context, id string) (*Session, error)
60
61 // GetSessionLogsFunc mocks the GetSessionLogs method.
62 GetSessionLogsFunc func(ctx context.Context, id string) ([]byte, error)
63
64 // ListLatestSessionsForViewerFunc mocks the ListLatestSessionsForViewer method.
65 ListLatestSessionsForViewerFunc func(ctx context.Context, limit int) ([]*Session, error)
66
67 // ListSessionsByResourceIDFunc mocks the ListSessionsByResourceID method.
68 ListSessionsByResourceIDFunc func(ctx context.Context, resourceType string, resourceID int64, limit int) ([]*Session, error)
69
70 // calls tracks calls to the methods.
71 calls struct {
72 // CreateJob holds details about calls to the CreateJob method.
73 CreateJob []struct {
74 // Ctx is the ctx argument value.
75 Ctx context.Context
76 // Owner is the owner argument value.
77 Owner string
78 // Repo is the repo argument value.
79 Repo string
80 // ProblemStatement is the problemStatement argument value.
81 ProblemStatement string
82 // BaseBranch is the baseBranch argument value.
83 BaseBranch string
84 // CustomAgent is the customAgent argument value.
85 CustomAgent string
86 }
87 // GetJob holds details about calls to the GetJob method.
88 GetJob []struct {
89 // Ctx is the ctx argument value.
90 Ctx context.Context
91 // Owner is the owner argument value.
92 Owner string
93 // Repo is the repo argument value.
94 Repo string
95 // JobID is the jobID argument value.
96 JobID string
97 }
98 // GetPullRequestDatabaseID holds details about calls to the GetPullRequestDatabaseID method.
99 GetPullRequestDatabaseID []struct {
100 // Ctx is the ctx argument value.
101 Ctx context.Context
102 // Hostname is the hostname argument value.
103 Hostname string
104 // Owner is the owner argument value.
105 Owner string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected