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