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

Function TestUserNotLoggedIn

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

Source from the content-addressed store, hash-verified

187}
188
189func TestUserNotLoggedIn(t *testing.T) {
190 // Given we have not logged in
191 authCfg := newTestAuthConfig(t)
192
193 // When we get the user
194 _, err := authCfg.ActiveUser("github.com")
195
196 // Then it returns failure, bubbling the KeyNotFoundError
197 var keyNotFoundError *ghConfig.KeyNotFoundError
198 require.ErrorAs(t, err, &keyNotFoundError)
199}
200
201func TestHostsIncludesEnvVar(t *testing.T) {
202 // 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