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

Function TestNew_WithTransportOptions

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

Source from the content-addressed store, hash-verified

238}
239
240func TestNew_WithTransportOptions(t *testing.T) {
241 t.Parallel()
242
243 c, err := New(
244 WithTransportOptions(
245 elastictransport.WithTransport(&mockTransp{}),
246 elastictransport.WithMaxRetries(5),
247 ),
248 )
249 if err != nil {
250 t.Fatalf("Unexpected error: %s", err)
251 }
252
253 _, err = c.Perform(&http.Request{URL: &url.URL{}, Header: make(http.Header)})
254 if err != nil {
255 t.Fatalf("Unexpected error: %s", err)
256 }
257}
258
259func TestNew_WithCompatibilityMode(t *testing.T) {
260 t.Parallel()

Callers

nothing calls this directly

Calls 3

WithTransportOptionsFunction · 0.85
PerformMethod · 0.65
NewFunction · 0.50

Tested by

no test coverage detected