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

Function TestNewHTTPClientVerboseWithoutLog

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

Source from the content-addressed store, hash-verified

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