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

Function TestNew_WithAddresses

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

Source from the content-addressed store, hash-verified

45}
46
47func TestNew_WithAddresses(t *testing.T) {
48 t.Parallel()
49 c, err := New(WithAddresses("http://localhost:8080//"))
50 if err != nil {
51 t.Fatalf("Unexpected error: %s", err)
52 }
53 u := c.Transport.(*elastictransport.Client).URLs()[0].String()
54 if u != "http://localhost:8080" {
55 t.Errorf("Unexpected URL, want=http://localhost:8080, got=%s", u)
56 }
57}
58
59func TestNew_WithMultipleAddresses(t *testing.T) {
60 t.Parallel()

Callers

nothing calls this directly

Calls 3

WithAddressesFunction · 0.85
NewFunction · 0.50
StringMethod · 0.45

Tested by

no test coverage detected