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

Function TestTokenFromKeyringNonExistent

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

Source from the content-addressed store, hash-verified

136}
137
138func TestTokenFromKeyringNonExistent(t *testing.T) {
139 // Given a keyring that doesn't contain any tokens
140 authCfg := newTestAuthConfig(t)
141
142 // When we try to get a token from the auth config
143 _, err := authCfg.TokenFromKeyring("github.com")
144
145 // Then it returns failure bubbling the ErrNotFound
146 require.ErrorContains(t, err, "secret not found in keyring")
147}
148
149func TestHasEnvTokenWithoutAnyEnvToken(t *testing.T) {
150 // Given we have no env set

Callers

nothing calls this directly

Calls 2

newTestAuthConfigFunction · 0.85
TokenFromKeyringMethod · 0.65

Tested by

no test coverage detected