Exemplo n.º 1
0
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())
}
Exemplo n.º 2
0
func TestShouldNotRetryRandomError(t *testing.T) {
	var r Transport
	ensure.False(t, r.shouldRetryError(errors.New("")))
}