MCPcopy
hub / github.com/expr-lang/expr / TestHTTPStatusesWrapper

Function TestHTTPStatusesWrapper

internal/testify/assert/http_assertions_test.go:133–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func TestHTTPStatusesWrapper(t *testing.T) {
134 assert := New(t)
135 mockAssert := New(new(testing.T))
136
137 assert.Equal(mockAssert.HTTPSuccess(httpOK, "GET", "/", nil), true)
138 assert.Equal(mockAssert.HTTPSuccess(httpRedirect, "GET", "/", nil), false)
139 assert.Equal(mockAssert.HTTPSuccess(httpError, "GET", "/", nil), false)
140
141 assert.Equal(mockAssert.HTTPRedirect(httpOK, "GET", "/", nil), false)
142 assert.Equal(mockAssert.HTTPRedirect(httpRedirect, "GET", "/", nil), true)
143 assert.Equal(mockAssert.HTTPRedirect(httpError, "GET", "/", nil), false)
144
145 assert.Equal(mockAssert.HTTPError(httpOK, "GET", "/", nil), false)
146 assert.Equal(mockAssert.HTTPError(httpRedirect, "GET", "/", nil), false)
147 assert.Equal(mockAssert.HTTPError(httpError, "GET", "/", nil), true)
148}
149
150func httpHelloName(w http.ResponseWriter, r *http.Request) {
151 name := r.FormValue("name")

Callers

nothing calls this directly

Calls 5

NewFunction · 0.70
EqualMethod · 0.65
HTTPSuccessMethod · 0.45
HTTPRedirectMethod · 0.45
HTTPErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…