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

Function TestNewHTTPClientRejectsConfigAndRefreshingConfig

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

Source from the content-addressed store, hash-verified

270}
271
272func TestNewHTTPClientRejectsConfigAndRefreshingConfig(t *testing.T) {
273 // Config and RefreshingConfig are mutually exclusive, so supplying both is a programming error that must be
274 // reported rather than silently picking one.
275 _, err := NewHTTPClient(HTTPClientOptions{
276 Config: legacyConfig{},
277 RefreshingConfig: tinyConfig{},
278 })
279 require.EqualError(t, err, "provide either Config or RefreshingConfig, not both")
280}
281
282func TestAddAuthTokenHeaderLegacyConfig(t *testing.T) {
283 // 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