(url, body string)
| 65 | } |
| 66 | |
| 67 | func httpPost(url, body string) (*http.Response, string, error) { |
| 68 | r, err := http.NewRequest(http.MethodPost, url, strings.NewReader(body)) |
| 69 | if err != nil { |
| 70 | return nil, "", err |
| 71 | } |
| 72 | res, err := http.DefaultClient.Do(r) |
| 73 | if err != nil { |
| 74 | return nil, "", err |
| 75 | } |
| 76 | defer res.Body.Close() |
| 77 | data, err := ioutil.ReadAll(res.Body) |
| 78 | if err != nil { |
| 79 | return nil, "", err |
| 80 | } |
| 81 | return res, string(data), nil |
| 82 | } |
| 83 | |
| 84 | func TestCLIHandlers(t *testing.T) { |
| 85 | log.SetOutput(ioutil.Discard) |
no outgoing calls
no test coverage detected