MCPcopy Index your code
hub / github.com/docker/docker-agent / newFetchToolForTest

Function newFetchToolForTest

pkg/tools/builtin/fetch/fetch_test.go:33–35  ·  view source on GitHub ↗

newFetchToolForTest constructs a FetchTool that bypasses SSRF dial-time protection so tests can talk to httptest.NewServer (which binds to 127.0.0.1). It is defined in a *_test.go file so it is not compiled into release binaries. Production callers must use [New], which refuses non-public addresses

(opts ...ToolOption)

Source from the content-addressed store, hash-verified

31// caller options still take precedence (a later option overrides an
32// earlier one).
33func newFetchToolForTest(opts ...ToolOption) *ToolSet {
34 return New(append([]ToolOption{WithAllowPrivateIPs(true), WithExpander(js.NewJsExpander(&testEnvProvider{}))}, opts...)...)
35}
36
37func TestFetchToolWithOptions(t *testing.T) {
38 t.Parallel()

Callers 15

TestFetchToolWithOptionsFunction · 0.85
TestFetchTool_ToolsFunction · 0.85
TestFetchTool_StartStopFunction · 0.85
TestFetch_Call_SuccessFunction · 0.85
TestFetch_Call_NoURLsFunction · 0.85
TestFetch_MarkdownFunction · 0.85
TestFetch_TextFunction · 0.85
TestFetch_RobotsAllowedFunction · 0.85

Calls 4

NewJsExpanderFunction · 0.92
NewFunction · 0.70
WithAllowPrivateIPsFunction · 0.70
WithExpanderFunction · 0.70

Tested by

no test coverage detected