HTTPErrorf asserts that a specified handler returns an error status code. require.HTTPErrorf(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, msg string, args ...interface{})
| 752 | // |
| 753 | // Returns whether the assertion was successful (true) or not (false). |
| 754 | func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { |
| 755 | if h, ok := t.(tHelper); ok { |
| 756 | h.Helper() |
| 757 | } |
| 758 | if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) { |
| 759 | return |
| 760 | } |
| 761 | t.FailNow() |
| 762 | } |
| 763 | |
| 764 | // HTTPRedirect asserts that a specified handler returns a redirect status code. |
| 765 | // |
no test coverage detected