HTTPError asserts that a specified handler returns an error status code. require.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{})
| 737 | // |
| 738 | // Returns whether the assertion was successful (true) or not (false). |
| 739 | func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { |
| 740 | if h, ok := t.(tHelper); ok { |
| 741 | h.Helper() |
| 742 | } |
| 743 | if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) { |
| 744 | return |
| 745 | } |
| 746 | t.FailNow() |
| 747 | } |
| 748 | |
| 749 | // HTTPErrorf asserts that a specified handler returns an error status code. |
| 750 | // |