(t *testing.T)
| 826 | } |
| 827 | |
| 828 | func TestLogoutRightAfterMigrationRemovesHost(t *testing.T) { |
| 829 | // Given we have logged in before migration |
| 830 | authCfg := newTestAuthConfig(t) |
| 831 | host := "github.com" |
| 832 | user := "test-user" |
| 833 | token := "test-token" |
| 834 | |
| 835 | _, err := preMigrationLogin(authCfg, host, user, token, "ssh", false) |
| 836 | require.NoError(t, err) |
| 837 | |
| 838 | // When we migrate and logout |
| 839 | var m migration.MultiAccount |
| 840 | c := cfg{authCfg.cfg} |
| 841 | require.NoError(t, c.Migrate(m)) |
| 842 | |
| 843 | require.NoError(t, authCfg.Logout(host, user)) |
| 844 | |
| 845 | // Then the host is removed from the config |
| 846 | requireNoKey(t, authCfg.cfg, []string{hostsKey, "github.com"}) |
| 847 | } |
| 848 | |
| 849 | func TestLoginInsecurePostMigrationUsesConfigForToken(t *testing.T) { |
| 850 | // Given we have not logged in |
nothing calls this directly
no test coverage detected