MCPcopy Index your code
hub / github.com/imroc/req / assertSuccess

Function assertSuccess

req_test.go:356–365  ·  view source on GitHub ↗
(t *testing.T, resp *Response, err error)

Source from the content-addressed store, hash-verified

354}
355
356func assertSuccess(t *testing.T, resp *Response, err error) {
357 tests.AssertNoError(t, err)
358 tests.AssertNotNil(t, resp.Response)
359 tests.AssertNotNil(t, resp.Response.Body)
360 tests.AssertEqual(t, http.StatusOK, resp.StatusCode)
361 tests.AssertEqual(t, "200 OK", resp.Status)
362 if !resp.IsSuccessState() {
363 t.Error("Response.IsSuccessState should return true")
364 }
365}
366
367func assertIsError(t *testing.T, resp *Response, err error) {
368 tests.AssertNoError(t, err)

Callers 15

TestTrailerFunction · 0.85
TestRetryWithSetResultFunction · 0.85
TestRetryWithModifyFunction · 0.85
TestWrapRoundTripFunction · 0.85
TestTraceAllFunction · 0.85
TestAutoDecodeFunction · 0.85
TestSetCommonCookiesFunction · 0.85
TestSetCommonQueryStringFunction · 0.85
TestAddCommonQueryParamFunction · 0.85
TestSetCommonQueryParamFunction · 0.85
TestSetCommonQueryParamsFunction · 0.85

Calls 5

AssertNoErrorFunction · 0.92
AssertNotNilFunction · 0.92
AssertEqualFunction · 0.92
IsSuccessStateMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…