MCPcopy
hub / github.com/elastic/go-elasticsearch / TestNew_DefaultClient

Function TestNew_DefaultClient

options_test.go:35–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33)
34
35func 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
47func TestNew_WithAddresses(t *testing.T) {
48 t.Parallel()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.50
StringMethod · 0.45

Tested by

no test coverage detected