MCPcopy Create free account
hub / github.com/cli/cli / TestNewHTTPClientVerboseWithoutLog

Function TestNewHTTPClientVerboseWithoutLog

api/http_client_test.go:549–561  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

547}
548
549func TestNewHTTPClientVerboseWithoutLog(t *testing.T) {
550 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
551 w.WriteHeader(http.StatusNoContent)
552 }))
553 defer ts.Close()
554
555 client, err := NewHTTPClient(HTTPClientOptions{LogVerboseHTTP: true})
556 require.NoError(t, err)
557
558 res, err := client.Get(ts.URL)
559 require.NoError(t, err)
560 assert.Equal(t, http.StatusNoContent, res.StatusCode)
561}
562
563func TestNewHTTPClientTelemetryDisabler(t *testing.T) {
564 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 4

NewHTTPClientFunction · 0.85
EqualMethod · 0.80
CloseMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected