(t *testing.T)
| 1570 | } |
| 1571 | |
| 1572 | func Test_Request_Timeout_With_Server(t *testing.T) { |
| 1573 | t.Parallel() |
| 1574 | |
| 1575 | app, ln, start := createHelperServer(t) |
| 1576 | app.Get("/", func(c fiber.Ctx) error { |
| 1577 | time.Sleep(time.Millisecond * 200) |
| 1578 | return c.SendString("timeout") |
| 1579 | }) |
| 1580 | go start() |
| 1581 | |
| 1582 | client := New().SetDial(ln) |
| 1583 | |
| 1584 | _, err := AcquireRequest(). |
| 1585 | SetClient(client). |
| 1586 | SetTimeout(50 * time.Millisecond). |
| 1587 | Get("http://example.com") |
| 1588 | |
| 1589 | require.Equal(t, ErrTimeoutOrCancel, err) |
| 1590 | } |
| 1591 | |
| 1592 | func Test_Request_MaxRedirects(t *testing.T) { |
| 1593 | t.Parallel() |
nothing calls this directly
no test coverage detected