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

Function TestFindWorkflow_nonHTTPError

pkg/cmd/workflow/shared/shared_test.go:176–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestFindWorkflow_nonHTTPError(t *testing.T) {
177 t.Run("When the client fails to instantiate, it returns the error", func(t *testing.T) {
178 client := api.NewClientFromHTTP(&http.Client{Transport: &ErrorTransport{Err: errors.New("non-HTTP error")}})
179 repo := ghrepo.New("OWNER", "REPO")
180 workflow, err := FindWorkflow(client, repo, "1", nil)
181
182 require.Error(t, err)
183 assert.ErrorContains(t, err, "non-HTTP error")
184 assert.Nil(t, workflow)
185 })
186}
187
188func Test_getWorkflowsByName_filtering(t *testing.T) {
189 tests := []struct {

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
FindWorkflowFunction · 0.85
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected