MCPcopy
hub / github.com/github/github-mcp-server / TestFetcher_DefaultOptions

Function TestFetcher_DefaultOptions

pkg/scopes/fetcher_test.go:188–200  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

186}
187
188func TestFetcher_DefaultOptions(t *testing.T) {
189 apiHost := testAPIHostResolver{baseURL: "https://api.github.com"}
190 fetcher := NewFetcher(apiHost, FetcherOptions{})
191
192 // Verify default API host is set
193 apiURL, err := fetcher.apiHost.BaseRESTURL(context.Background())
194 require.NoError(t, err)
195 assert.Equal(t, "https://api.github.com", apiURL.String())
196
197 // Verify default HTTP client is set with timeout
198 assert.NotNil(t, fetcher.client)
199 assert.Equal(t, DefaultFetchTimeout, fetcher.client.Timeout)
200}
201
202func TestFetcher_CustomHTTPClient(t *testing.T) {
203 customClient := &http.Client{Timeout: 5 * time.Second}

Callers

nothing calls this directly

Calls 3

NewFetcherFunction · 0.85
BaseRESTURLMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected