(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestTokenStoredInKeyring(t *testing.T) { |
| 125 | // When the user has logged in securely |
| 126 | authCfg := newTestAuthConfig(t) |
| 127 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", true) |
| 128 | require.NoError(t, err) |
| 129 | |
| 130 | // When we get the token |
| 131 | cred := authCfg.ActiveToken("github.com") |
| 132 | token, source := cred.Token, cred.Source |
| 133 | |
| 134 | // Then the token is successfully fetched |
| 135 | // and the source is set to keyring |
| 136 | require.Equal(t, "test-token", token) |
| 137 | require.Equal(t, "keyring", source) |
| 138 | } |
| 139 | |
| 140 | func TestTokenFromKeyringNonExistent(t *testing.T) { |
| 141 | // Given a keyring that doesn't contain any tokens |
nothing calls this directly
no test coverage detected