HTTPError asserts that a specified handler returns an error status code. assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} Returns whether the assertion was successful (true) or not (false).
(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{})
| 724 | // |
| 725 | // Returns whether the assertion was successful (true) or not (false). |
| 726 | func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { |
| 727 | if h, ok := t.(tHelper); ok { |
| 728 | h.Helper() |
| 729 | } |
| 730 | if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) { |
| 731 | return |
| 732 | } |
| 733 | t.FailNow() |
| 734 | } |
| 735 | |
| 736 | // HTTPErrorf asserts that a specified handler returns an error status code. |
| 737 | // |