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