(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func TestNew_DefaultClient(t *testing.T) { |
| 36 | t.Setenv("ELASTICSEARCH_URL", "") |
| 37 | c, err := New() |
| 38 | if err != nil { |
| 39 | t.Fatalf("Unexpected error: %s", err) |
| 40 | } |
| 41 | u := c.Transport.(*elastictransport.Client).URLs()[0].String() |
| 42 | if u != defaultURL { |
| 43 | t.Errorf("Unexpected URL, want=%s, got=%s", defaultURL, u) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestNew_WithAddresses(t *testing.T) { |
| 48 | t.Parallel() |