options_test.go 302 B

12345678910111213141516
  1. package client
  2. import (
  3. "testing"
  4. "time"
  5. "gotest.tools/v3/assert"
  6. )
  7. func TestOptionWithTimeout(t *testing.T) {
  8. timeout := 10 * time.Second
  9. c, err := NewClientWithOpts(WithTimeout(timeout))
  10. assert.NilError(t, err)
  11. assert.Check(t, c.client != nil)
  12. assert.Equal(t, c.client.Timeout, timeout)
  13. }