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

Function TestUserNotLoggedIn

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

Source from the content-addressed store, hash-verified

174}
175
176func TestUserNotLoggedIn(t *testing.T) {
177 // Given we have not logged in
178 authCfg := newTestAuthConfig(t)
179
180 // When we get the user
181 _, err := authCfg.ActiveUser("github.com")
182
183 // Then it returns failure, bubbling the KeyNotFoundError
184 var keyNotFoundError *ghConfig.KeyNotFoundError
185 require.ErrorAs(t, err, &keyNotFoundError)
186}
187
188func TestHostsIncludesEnvVar(t *testing.T) {
189 // 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