func TestCancelRequest(t *testing.T) { var called bool timer := time.AfterFunc(time.Hour, func() { called = true }) var r Transport r.CancelRequest(&http.Request{ Body: &bodyCloser{ timer: timer, }, }) ensure.False(t, called) ensure.False(t, timer.Stop()) }
func TestShouldNotRetryRandomError(t *testing.T) { var r Transport ensure.False(t, r.shouldRetryError(errors.New(""))) }