(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestTokenFromKeyringForUser(t *testing.T) { |
| 44 | // Given a keyring that contains a token for a host with a specific user |
| 45 | authCfg := newTestAuthConfig(t) |
| 46 | require.NoError(t, keyring.Set(keyringServiceName("github.com"), "test-user", "test-token")) |
| 47 | |
| 48 | // When we get the token from the auth config |
| 49 | token, err := authCfg.TokenFromKeyringForUser("github.com", "test-user") |
| 50 | |
| 51 | // Then it returns successfully with the correct token |
| 52 | require.NoError(t, err) |
| 53 | require.Equal(t, "test-token", token) |
| 54 | } |
| 55 | |
| 56 | func TestTokenFromKeyringForUserErrorsIfUsernameIsBlank(t *testing.T) { |
| 57 | authCfg := newTestAuthConfig(t) |
nothing calls this directly
no test coverage detected