MCPcopy
hub / github.com/cli/cli / QueryMatcher

Function QueryMatcher

pkg/httpmock/stub.go:91–107  ·  view source on GitHub ↗
(method string, path string, query url.Values)

Source from the content-addressed store, hash-verified

89}
90
91func QueryMatcher(method string, path string, query url.Values) Matcher {
92 return func(req *http.Request) bool {
93 if !REST(method, path)(req) {
94 return false
95 }
96
97 actualQuery := req.URL.Query()
98
99 for param := range query {
100 if !(actualQuery.Get(param) == query.Get(param)) {
101 return false
102 }
103 }
104
105 return true
106 }
107}
108
109func readBody(req *http.Request) ([]byte, error) {
110 bodyCopy := &bytes.Buffer{}

Callers 14

TestSearcherCodeFunction · 0.92
TestSearcherCommitsFunction · 0.92
TestSearcherRepositoriesFunction · 0.92
TestSearcherIssuesFunction · 0.92
TestDeleteRunFunction · 0.92
TestViewRunFunction · 0.92
TestListRunFunction · 0.92

Calls 3

RESTFunction · 0.85
QueryMethod · 0.65
GetMethod · 0.65

Tested by 14

TestSearcherCodeFunction · 0.74
TestSearcherCommitsFunction · 0.74
TestSearcherRepositoriesFunction · 0.74
TestSearcherIssuesFunction · 0.74
TestDeleteRunFunction · 0.74
TestViewRunFunction · 0.74
TestListRunFunction · 0.74