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

Function Test_apiRun_HEAD

pkg/cmd/api/api_test.go:1237–1264  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1235}
1236
1237func Test_apiRun_HEAD(t *testing.T) {
1238 ios, _, _, _ := iostreams.Test()
1239
1240 err := apiRun(&ApiOptions{
1241 IO: ios,
1242 Config: func() (gh.Config, error) {
1243 return config.NewBlankConfig(), nil
1244 },
1245 HttpClient: func() (*http.Client, error) {
1246 var tr roundTripper = func(req *http.Request) (*http.Response, error) {
1247 return &http.Response{
1248 StatusCode: 422,
1249 Request: req,
1250 Header: map[string][]string{
1251 "Content-Type": {"application/json"},
1252 }}, nil
1253 }
1254 return &http.Client{Transport: tr}, nil
1255 },
1256 MagicFields: []string(nil),
1257 RawFields: []string(nil),
1258 RequestMethod: "HEAD",
1259 RequestMethodPassed: true,
1260 })
1261 if err != cmdutil.SilentError {
1262 t.Fatalf("got error %v", err)
1263 }
1264}
1265
1266func Test_apiRun_inputFile(t *testing.T) {
1267 tests := []struct {

Callers

nothing calls this directly

Calls 3

TestFunction · 0.92
NewBlankConfigFunction · 0.92
apiRunFunction · 0.85

Tested by

no test coverage detected