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

Function TestTokenForUserInsecureLogin

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

Source from the content-addressed store, hash-verified

641}
642
643func TestTokenForUserInsecureLogin(t *testing.T) {
644 // Given a user has logged in insecurely
645 authCfg := newTestAuthConfig(t)
646 _, err := authCfg.Login("github.com", "test-user-1", "test-token", "ssh", false)
647 require.NoError(t, err)
648
649 // When we get the token
650 token, source, err := authCfg.TokenForUser("github.com", "test-user-1")
651
652 // Then it returns the token and the source as oauth_token
653 require.NoError(t, err)
654 require.Equal(t, "test-token", token)
655 require.Equal(t, "oauth_token", source)
656}
657
658func TestTokenForUserNotFoundErrors(t *testing.T) {
659 // Given a user has not logged in

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