MCPcopy Create free account
hub / github.com/imroc/req / TestRetryFalse

Function TestRetryFalse

retry_test.go:164–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

162}
163
164func TestRetryFalse(t *testing.T) {
165 resp, err := tc().SetTimeout(2 * time.Second).R().
166 SetRetryCount(1).
167 SetRetryCondition(func(resp *Response, err error) bool {
168 return false
169 }).Get("https://non-exists-host.com.cn")
170 tests.AssertNotNil(t, err)
171 tests.AssertIsNil(t, resp.Response)
172 tests.AssertEqual(t, 0, resp.Request.RetryAttempt)
173}
174
175func TestRetryTurnedOffWhenRetryCountEqZero(t *testing.T) {
176 resp, err := tc().SetTimeout(2 * time.Second).R().

Callers

nothing calls this directly

Calls 9

AssertNotNilFunction · 0.92
AssertIsNilFunction · 0.92
AssertEqualFunction · 0.92
tcFunction · 0.85
SetRetryConditionMethod · 0.80
SetRetryCountMethod · 0.80
RMethod · 0.80
SetTimeoutMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…