MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / TestDeleteStandard

Function TestDeleteStandard

pkg/httpcli/httpcli_test.go:117–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestDeleteStandard(t *testing.T) {
118 requestAddr := runGoHTTPServer()
119
120 req := New()
121 req.SetURL(requestAddr + "/delete")
122 req.SetHeaders(map[string]string{
123 "Authorization": "Bearer token",
124 })
125 req.SetParams(KV{
126 "uid": 123,
127 })
128
129 resp, err := req.DELETE()
130 if err != nil {
131 t.Fatal(err)
132 }
133
134 result := &StdResult{}
135 err = resp.BindJSON(result)
136 if err != nil {
137 t.Fatal(err)
138 }
139
140 t.Logf("%+v", result)
141}
142
143func TestPostStandard(t *testing.T) {
144 requestAddr := runGoHTTPServer()

Callers

nothing calls this directly

Calls 8

runGoHTTPServerFunction · 0.85
SetURLMethod · 0.80
SetHeadersMethod · 0.80
SetParamsMethod · 0.80
DELETEMethod · 0.80
BindJSONMethod · 0.80
NewFunction · 0.70
FatalMethod · 0.45

Tested by

no test coverage detected