MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / BodyFor

Method BodyFor

fetch_test.go:104–118  ·  view source on GitHub ↗
(rawurl string)

Source from the content-addressed store, hash-verified

102}
103
104func (sh *spyHandler) BodyFor(rawurl string) string {
105 sh.mu.Lock()
106 defer sh.mu.Unlock()
107 ix := -1
108 for i, c := range sh.cmds {
109 if c.URL().String() == rawurl {
110 ix = i
111 break
112 }
113 }
114 if ix >= 0 {
115 return sh.bodies[ix]
116 }
117 return ""
118}
119
120func (sh *spyHandler) CalledWithExactly(rawurl ...string) bool {
121 sh.mu.Lock()

Callers 3

TestBodyFunction · 0.95
TestHeaderFunction · 0.95
TestFullCmdFunction · 0.95

Calls 1

URLMethod · 0.65

Tested by

no test coverage detected