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

Function TestTokenFromKeyringNonExistent

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

Source from the content-addressed store, hash-verified

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