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

Function TestDefaultHostNotLoggedIn

internal/config/auth_config_test.go:228–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

226}
227
228func TestDefaultHostNotLoggedIn(t *testing.T) {
229 // Given we are not logged in
230 authCfg := newTestAuthConfig(t)
231
232 // When we get the DefaultHost
233 defaultHost, source := authCfg.DefaultHost()
234
235 // Then the returned host is always github.com
236 require.Equal(t, "github.com", defaultHost)
237 require.Equal(t, "default", source)
238}
239
240func TestDefaultHostLoggedInToOnlyOneHost(t *testing.T) {
241 // Given we are logged into one host (not github.com to differentiate from the fallback)

Callers

nothing calls this directly

Calls 3

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
DefaultHostMethod · 0.65

Tested by

no test coverage detected