MCPcopy
hub / github.com/cli/cli / TestDefaultHostNotLoggedIn

Function TestDefaultHostNotLoggedIn

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

Source from the content-addressed store, hash-verified

210}
211
212func TestDefaultHostNotLoggedIn(t *testing.T) {
213 // Given we are not logged in
214 authCfg := newTestAuthConfig(t)
215
216 // When we get the DefaultHost
217 defaultHost, source := authCfg.DefaultHost()
218
219 // Then the returned host is always github.com
220 require.Equal(t, "github.com", defaultHost)
221 require.Equal(t, "default", source)
222}
223
224func TestDefaultHostLoggedInToOnlyOneHost(t *testing.T) {
225 // 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