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

Function TestUserNotLoggedIn

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

Source from the content-addressed store, hash-verified

189}
190
191func TestUserNotLoggedIn(t *testing.T) {
192 // Given we have not logged in
193 authCfg := newTestAuthConfig(t)
194
195 // When we get the user
196 _, err := authCfg.ActiveUser("github.com")
197
198 // Then it returns failure, bubbling the KeyNotFoundError
199 var keyNotFoundError *ghConfig.KeyNotFoundError
200 require.ErrorAs(t, err, &keyNotFoundError)
201}
202
203func TestHostsIncludesEnvVar(t *testing.T) {
204 // Given the GH_HOST env var is set

Callers

nothing calls this directly

Calls 2

newTestAuthConfigFunction · 0.85
ActiveUserMethod · 0.65

Tested by

no test coverage detected