(t *testing.T)
| 1347 | } |
| 1348 | |
| 1349 | func Test_apiRun_HEAD(t *testing.T) { |
| 1350 | ios, _, _, _ := iostreams.Test() |
| 1351 | |
| 1352 | err := apiRun(&ApiOptions{ |
| 1353 | IO: ios, |
| 1354 | Config: func() (gh.Config, error) { |
| 1355 | return config.NewMockConfig(), nil |
| 1356 | }, |
| 1357 | HttpClient: func(rootapi.HTTPClientOptions) (*http.Client, error) { |
| 1358 | var tr roundTripper = func(req *http.Request) (*http.Response, error) { |
| 1359 | return &http.Response{ |
| 1360 | StatusCode: 422, |
| 1361 | Request: req, |
| 1362 | Header: map[string][]string{ |
| 1363 | "Content-Type": {"application/json"}, |
| 1364 | }}, nil |
| 1365 | } |
| 1366 | return &http.Client{Transport: tr}, nil |
| 1367 | }, |
| 1368 | MagicFields: []string(nil), |
| 1369 | RawFields: []string(nil), |
| 1370 | RequestMethod: "HEAD", |
| 1371 | RequestMethodPassed: true, |
| 1372 | }) |
| 1373 | if err != cmdutil.SilentError { |
| 1374 | t.Fatalf("got error %v", err) |
| 1375 | } |
| 1376 | } |
| 1377 | |
| 1378 | func Test_apiRun_inputFile(t *testing.T) { |
| 1379 | tests := []struct { |
nothing calls this directly
no test coverage detected