MCPcopy
hub / github.com/cli/cli / FileResponse

Function FileResponse

pkg/httpmock/stub.go:191–199  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

189}
190
191func FileResponse(filename string) Responder {
192 return func(req *http.Request) (*http.Response, error) {
193 f, err := os.Open(filename)
194 if err != nil {
195 return nil, err
196 }
197 return httpResponse(200, req, f), nil
198 }
199}
200
201func RESTPayload(responseStatus int, responseBody string, cb func(payload map[string]interface{})) Responder {
202 return func(req *http.Request) (*http.Response, error) {

Callers 15

Test_viewRunFunction · 0.92
Test_listRunFunction · 0.92
Test_checkRunFunction · 0.92
TestIssueList_nonttyFunction · 0.92
TestIssueList_ttyFunction · 0.92
TestIssueStatusFunction · 0.92
TestRepoList_nonttyFunction · 0.92
TestRepoList_ttyFunction · 0.92

Calls 2

httpResponseFunction · 0.85
OpenMethod · 0.80

Tested by 15

Test_viewRunFunction · 0.74
Test_listRunFunction · 0.74
Test_checkRunFunction · 0.74
TestIssueList_nonttyFunction · 0.74
TestIssueList_ttyFunction · 0.74
TestIssueStatusFunction · 0.74
TestRepoList_nonttyFunction · 0.74
TestRepoList_ttyFunction · 0.74