(t *testing.T)
| 753 | } |
| 754 | |
| 755 | func TestTokenWorksRightAfterMigration(t *testing.T) { |
| 756 | // Given we have logged in before migration |
| 757 | authCfg := newTestAuthConfig(t) |
| 758 | _, err := preMigrationLogin(authCfg, "github.com", "test-user", "test-token", "ssh", false) |
| 759 | require.NoError(t, err) |
| 760 | |
| 761 | // When we migrate |
| 762 | var m migration.MultiAccount |
| 763 | c := cfg{authCfg.cfg} |
| 764 | require.NoError(t, c.Migrate(m)) |
| 765 | |
| 766 | // Then we can still get the token correctly |
| 767 | token, source := authCfg.ActiveToken("github.com") |
| 768 | require.Equal(t, "test-token", token) |
| 769 | require.Equal(t, oauthTokenKey, source) |
| 770 | } |
| 771 | |
| 772 | func TestTokenPrioritizesActiveUserToken(t *testing.T) { |
| 773 | // Given a keyring where the active slot contains the token from a previous user |
nothing calls this directly
no test coverage detected