MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestClient_Option

Function TestClient_Option

clihttp/client_test.go:66–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestClient_Option(t *testing.T) {
67 t.Parallel()
68 client := NewClient(opentracing.NoopTracer{}, []Option{
69 WithResponseLogThreshold(0),
70 WithRequestLogThreshold(0),
71 }...)
72 assert.Zero(t, client.requestLogThreshold)
73 assert.Zero(t, client.responseLogThreshold)
74 req, _ := http.NewRequest(http.MethodGet, "https://example.com/", nil)
75 resp, _ := client.Do(req)
76 defer resp.Body.Close()
77}
78
79func TestClient_race(t *testing.T) {
80 // the mock tracer is not concurrent safe.

Callers

nothing calls this directly

Calls 5

DoMethod · 0.95
NewClientFunction · 0.85
WithResponseLogThresholdFunction · 0.85
WithRequestLogThresholdFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected