(t *testing.T)
| 162 | } |
| 163 | |
| 164 | func 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 | |
| 175 | func TestRetryTurnedOffWhenRetryCountEqZero(t *testing.T) { |
| 176 | resp, err := tc().SetTimeout(2 * time.Second).R(). |
nothing calls this directly
no test coverage detected
searching dependent graphs…