MCPcopy
hub / github.com/mislav/hub / TestNewHttpClient_UnixSocket

Function TestNewHttpClient_UnixSocket

github/http_test.go:70–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestNewHttpClient_UnixSocket(t *testing.T) {
71 sock := "/tmp/hub-go.sock"
72 s := setupTestServer(sock)
73 defer s.Close()
74
75 s.HandleFunc("/unix-socket", func(w http.ResponseWriter, r *http.Request) {
76 w.Write([]byte("unix-socket-works"))
77 })
78 c := newHttpClient("", false, sock)
79 resp, err := c.Get(fmt.Sprintf("%s/unix-socket", s.URL.String()))
80 assert.Equal(t, nil, err)
81 result, _ := ioutil.ReadAll(resp.Body)
82 assert.Equal(t, "unix-socket-works", string(result))
83}
84
85func TestVerboseTransport_VerbosePrintln(t *testing.T) {
86 var b bytes.Buffer

Callers

nothing calls this directly

Calls 5

setupTestServerFunction · 0.85
newHttpClientFunction · 0.85
GetMethod · 0.80
CloseMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…