MCPcopy
hub / github.com/cli/cli / Verify

Method Verify

pkg/httpmock/registry.go:60–80  ·  view source on GitHub ↗
(t Testing)

Source from the content-addressed store, hash-verified

58}
59
60func (r *Registry) Verify(t Testing) {
61 var unmatchedStubStacks []string
62 for _, s := range r.stubs {
63 if !s.matched && !s.exclude {
64 unmatchedStubStacks = append(unmatchedStubStacks, s.Stack)
65 }
66 }
67 if len(unmatchedStubStacks) > 0 {
68 t.Helper()
69 stacks := strings.Builder{}
70 for i, stack := range unmatchedStubStacks {
71 stacks.WriteString(fmt.Sprintf("Stub %d:\n", i+1))
72 stacks.WriteString(fmt.Sprintf("\t%s", stack))
73 if stack != unmatchedStubStacks[len(unmatchedStubStacks)-1] {
74 stacks.WriteString("\n")
75 }
76 }
77 // about dead stubs and what they were trying to match
78 t.Errorf("%d HTTP stubs unmatched, stacks:\n%s", len(unmatchedStubStacks), stacks.String())
79 }
80}
81
82// RoundTrip satisfies http.RoundTripper
83func (r *Registry) RoundTrip(req *http.Request) (*http.Response, error) {

Callers 15

TestSearcherCodeFunction · 0.95
TestSearcherCommitsFunction · 0.95
TestSearcherRepositoriesFunction · 0.95
TestSearcherIssuesFunction · 0.95
TestDeleteRunFunction · 0.95
TestListRunFunction · 0.95
TestListFunction · 0.95
TestSearchFunction · 0.95
TestListCategoriesFunction · 0.95
TestGetByNumberFunction · 0.95
TestGetWithCommentsFunction · 0.95

Calls 3

HelperMethod · 0.65
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by 15

TestSearcherCodeFunction · 0.76
TestSearcherCommitsFunction · 0.76
TestSearcherRepositoriesFunction · 0.76
TestSearcherIssuesFunction · 0.76
TestDeleteRunFunction · 0.76
TestListRunFunction · 0.76
TestListFunction · 0.76
TestSearchFunction · 0.76
TestListCategoriesFunction · 0.76
TestGetByNumberFunction · 0.76
TestGetWithCommentsFunction · 0.76