(t *testing.T)
| 108 | } |
| 109 | |
| 110 | func TestTokenStoredInKeyring(t *testing.T) { |
| 111 | // When the user has logged in securely |
| 112 | authCfg := newTestAuthConfig(t) |
| 113 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", true) |
| 114 | require.NoError(t, err) |
| 115 | |
| 116 | // When we get the token |
| 117 | token, source := authCfg.ActiveToken("github.com") |
| 118 | |
| 119 | // Then the token is successfully fetched |
| 120 | // and the source is set to keyring |
| 121 | require.Equal(t, "test-token", token) |
| 122 | require.Equal(t, "keyring", source) |
| 123 | } |
| 124 | |
| 125 | func TestTokenFromKeyringNonExistent(t *testing.T) { |
| 126 | // Given a keyring that doesn't contain any tokens |
nothing calls this directly
no test coverage detected