(t *testing.T)
| 1386 | } |
| 1387 | |
| 1388 | func Test_apiRun_DELETE(t *testing.T) { |
| 1389 | ios, _, _, _ := iostreams.Test() |
| 1390 | |
| 1391 | var gotRequest *http.Request |
| 1392 | err := apiRun(&ApiOptions{ |
| 1393 | IO: ios, |
| 1394 | Config: func() (gh.Config, error) { |
| 1395 | return config.NewMockConfig(), nil |
| 1396 | }, |
| 1397 | HttpClient: func(rootapi.HTTPClientOptions) (*http.Client, error) { |
| 1398 | var tr roundTripper = func(req *http.Request) (*http.Response, error) { |
| 1399 | gotRequest = req |
| 1400 | return &http.Response{StatusCode: 204, Request: req}, nil |
| 1401 | } |
| 1402 | return &http.Client{Transport: tr}, nil |
| 1403 | }, |
| 1404 | MagicFields: []string(nil), |
| 1405 | RawFields: []string(nil), |
| 1406 | RequestMethod: "DELETE", |
| 1407 | RequestMethodPassed: true, |
| 1408 | }) |
| 1409 | if err != nil { |
| 1410 | t.Fatalf("got error %v", err) |
| 1411 | } |
| 1412 | |
| 1413 | if gotRequest.Body != nil { |
| 1414 | t.Errorf("expected nil request body, got %T", gotRequest.Body) |
| 1415 | } |
| 1416 | } |
| 1417 | |
| 1418 | func Test_apiRun_HEAD(t *testing.T) { |
| 1419 | ios, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected