MCPcopy Create free account
hub / github.com/code-scan/Goal / TestHead

Function TestHead

tests/http_test.go:77–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75 log.Println("log post")
76}
77func TestHead(t *testing.T) {
78 log.Println("Ghttp test head")
79 httpClient := Ghttp.Http{}
80 go func() {
81 httpClient.Head("https://httpbin.org/head")
82 httpClient.Execute()
83 log.Println(httpClient.StatusCode())
84
85 }()
86 go func() {
87 httpClient.Head("https://httpbin.org/get")
88 httpClient.Execute()
89 log.Println(httpClient.StatusCode())
90
91 }()
92 time.Sleep(time.Duration(time.Second * 5))
93 log.Println(httpClient.StatusCode())
94}
95func TestManyReq(t *testing.T) {
96 f, _ := os.OpenFile("cpu.pprof", os.O_CREATE|os.O_RDWR, 0644)
97 pprof.StartCPUProfile(f)

Callers

nothing calls this directly

Calls 3

HeadMethod · 0.95
ExecuteMethod · 0.95
StatusCodeMethod · 0.95

Tested by

no test coverage detected