MCPcopy Create free account
hub / github.com/cli/cli / Test_apiRun_HEAD

Function Test_apiRun_HEAD

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

Source from the content-addressed store, hash-verified

1315}
1316
1317func Test_apiRun_HEAD(t *testing.T) {
1318 ios, _, _, _ := iostreams.Test()
1319
1320 err := apiRun(&ApiOptions{
1321 IO: ios,
1322 Config: func() (gh.Config, error) {
1323 return config.NewBlankConfig(), nil
1324 },
1325 HttpClient: func() (*http.Client, error) {
1326 var tr roundTripper = func(req *http.Request) (*http.Response, error) {
1327 return &http.Response{
1328 StatusCode: 422,
1329 Request: req,
1330 Header: map[string][]string{
1331 "Content-Type": {"application/json"},
1332 }}, nil
1333 }
1334 return &http.Client{Transport: tr}, nil
1335 },
1336 MagicFields: []string(nil),
1337 RawFields: []string(nil),
1338 RequestMethod: "HEAD",
1339 RequestMethodPassed: true,
1340 })
1341 if err != cmdutil.SilentError {
1342 t.Fatalf("got error %v", err)
1343 }
1344}
1345
1346func Test_apiRun_inputFile(t *testing.T) {
1347 tests := []struct {

Callers

nothing calls this directly

Calls 3

TestFunction · 0.92
NewBlankConfigFunction · 0.92
apiRunFunction · 0.85

Tested by

no test coverage detected