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

Function TestTokenFromKeyringNonExistent

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

Source from the content-addressed store, hash-verified

123}
124
125func TestTokenFromKeyringNonExistent(t *testing.T) {
126 // Given a keyring that doesn't contain any tokens
127 authCfg := newTestAuthConfig(t)
128
129 // When we try to get a token from the auth config
130 _, err := authCfg.TokenFromKeyring("github.com")
131
132 // Then it returns failure bubbling the ErrNotFound
133 require.ErrorContains(t, err, "secret not found in keyring")
134}
135
136func TestHasEnvTokenWithoutAnyEnvToken(t *testing.T) {
137 // 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