(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestTokenFromKeyringForUser(t *testing.T) { |
| 33 | // Given a keyring that contains a token for a host with a specific user |
| 34 | authCfg := newTestAuthConfig(t) |
| 35 | require.NoError(t, keyring.Set(keyringServiceName("github.com"), "test-user", "test-token")) |
| 36 | |
| 37 | // When we get the token from the auth config |
| 38 | token, err := authCfg.TokenFromKeyringForUser("github.com", "test-user") |
| 39 | |
| 40 | // Then it returns successfully with the correct token |
| 41 | require.NoError(t, err) |
| 42 | require.Equal(t, "test-token", token) |
| 43 | } |
| 44 | |
| 45 | func TestTokenFromKeyringForUserErrorsIfUsernameIsBlank(t *testing.T) { |
| 46 | authCfg := newTestAuthConfig(t) |
nothing calls this directly
no test coverage detected