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

Function TestTokenForUserSecureLogin

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

Source from the content-addressed store, hash-verified

626}
627
628func TestTokenForUserSecureLogin(t *testing.T) {
629 // Given a user has logged in securely
630 authCfg := newTestAuthConfig(t)
631 _, err := authCfg.Login("github.com", "test-user-1", "test-token", "ssh", true)
632 require.NoError(t, err)
633
634 // When we get the token
635 token, source, err := authCfg.TokenForUser("github.com", "test-user-1")
636
637 // Then it returns the token and the source as keyring
638 require.NoError(t, err)
639 require.Equal(t, "test-token", token)
640 require.Equal(t, "keyring", source)
641}
642
643func TestTokenForUserInsecureLogin(t *testing.T) {
644 // Given a user has logged in insecurely

Callers

nothing calls this directly

Calls 4

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
LoginMethod · 0.65
TokenForUserMethod · 0.65

Tested by

no test coverage detected