(t *testing.T)
| 1317 | } |
| 1318 | |
| 1319 | func Test_apiRun_DELETE(t *testing.T) { |
| 1320 | ios, _, _, _ := iostreams.Test() |
| 1321 | |
| 1322 | var gotRequest *http.Request |
| 1323 | err := apiRun(&ApiOptions{ |
| 1324 | IO: ios, |
| 1325 | Config: func() (gh.Config, error) { |
| 1326 | return config.NewMockConfig(), nil |
| 1327 | }, |
| 1328 | HttpClient: func(rootapi.HTTPClientOptions) (*http.Client, error) { |
| 1329 | var tr roundTripper = func(req *http.Request) (*http.Response, error) { |
| 1330 | gotRequest = req |
| 1331 | return &http.Response{StatusCode: 204, Request: req}, nil |
| 1332 | } |
| 1333 | return &http.Client{Transport: tr}, nil |
| 1334 | }, |
| 1335 | MagicFields: []string(nil), |
| 1336 | RawFields: []string(nil), |
| 1337 | RequestMethod: "DELETE", |
| 1338 | RequestMethodPassed: true, |
| 1339 | }) |
| 1340 | if err != nil { |
| 1341 | t.Fatalf("got error %v", err) |
| 1342 | } |
| 1343 | |
| 1344 | if gotRequest.Body != nil { |
| 1345 | t.Errorf("expected nil request body, got %T", gotRequest.Body) |
| 1346 | } |
| 1347 | } |
| 1348 | |
| 1349 | func Test_apiRun_HEAD(t *testing.T) { |
| 1350 | ios, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected