Note that I'm not sure this test enforces particularly desirable behaviour since it leads users to believe a token has been removed when really that might have failed for some reason. The original intention here is that if the logout fails, the user can't really do anything to recover. On the other
(t *testing.T)
| 437 | // really do anything to recover. On the other hand, a user might |
| 438 | // want to rectify this manually, for example if there were on a shared machine. |
| 439 | func TestLogoutIgnoresErrorsFromConfigAndKeyring(t *testing.T) { |
| 440 | // Given we have keyring that errors, and a config that |
| 441 | // doesn't even have a hosts key (which would cause Remove to fail) |
| 442 | keyring.MockInitWithError(errors.New("test-explosion")) |
| 443 | authCfg := newTestAuthConfig(t) |
| 444 | |
| 445 | // When we logout |
| 446 | err := authCfg.Logout("github.com", "test-user") |
| 447 | |
| 448 | // Then it returns success anyway, suppressing the errors |
| 449 | require.NoError(t, err) |
| 450 | } |
| 451 | |
| 452 | func TestSwitchUserMakesSecureTokenActive(t *testing.T) { |
| 453 | // Given we have a user with a secure token |
nothing calls this directly
no test coverage detected