MCPcopy Index your code
hub / github.com/cli/cli / TestUserNotLoggedIn

Function TestUserNotLoggedIn

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

Source from the content-addressed store, hash-verified

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