MCPcopy
hub / github.com/gofiber/fiber / TestHostClientTransportClientAccessor

Function TestHostClientTransportClientAccessor

client/transport_test.go:122–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestHostClientTransportClientAccessor(t *testing.T) {
123 t.Parallel()
124
125 host := &fasthttp.HostClient{Addr: "example.com:80"}
126 transport := newHostClientTransport(host)
127
128 current, ok := transport.Client().(*fasthttp.HostClient)
129 require.True(t, ok)
130 require.Same(t, host, current)
131
132 hostTLS := &tls.Config{ServerName: "host", MinVersion: tls.VersionTLS12}
133 host.TLSConfig = hostTLS
134
135 cfg := transport.TLSConfig()
136 require.Same(t, hostTLS, cfg)
137
138 override := &tls.Config{ServerName: "host-override", MinVersion: tls.VersionTLS13}
139 transport.SetTLSConfig(override)
140 require.Equal(t, override, host.TLSConfig)
141}
142
143func TestLBClientTransportAccessorsAndOverrides(t *testing.T) {
144 t.Parallel()

Callers

nothing calls this directly

Calls 4

newHostClientTransportFunction · 0.85
ClientMethod · 0.65
TLSConfigMethod · 0.65
SetTLSConfigMethod · 0.65

Tested by

no test coverage detected