MCPcopy Create free account
hub / github.com/cli/cli / TestNewHTTPClientRejectsConfigAndRefreshingConfig

Function TestNewHTTPClientRejectsConfigAndRefreshingConfig

api/http_client_test.go:271–279  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

269}
270
271func TestNewHTTPClientRejectsConfigAndRefreshingConfig(t *testing.T) {
272 // Config and RefreshingConfig are mutually exclusive, so supplying both is a programming error that must be
273 // reported rather than silently picking one.
274 _, err := NewHTTPClient(HTTPClientOptions{
275 Config: legacyConfig{},
276 RefreshingConfig: tinyConfig{},
277 })
278 require.EqualError(t, err, "provide either Config or RefreshingConfig, not both")
279}
280
281func TestAddAuthTokenHeaderLegacyConfig(t *testing.T) {
282 // Regression: the primitive config seam that external callers implement must keep attaching tokens, including the

Callers

nothing calls this directly

Calls 1

NewHTTPClientFunction · 0.85

Tested by

no test coverage detected