(t *testing.T)
| 873 | } |
| 874 | |
| 875 | func TestLogoutRightAfterMigrationRemovesHost(t *testing.T) { |
| 876 | // Given we have logged in before migration |
| 877 | authCfg := newTestAuthConfig(t) |
| 878 | host := "github.com" |
| 879 | user := "test-user" |
| 880 | token := "test-token" |
| 881 | |
| 882 | _, err := preMigrationLogin(authCfg, host, user, token, "ssh", false) |
| 883 | require.NoError(t, err) |
| 884 | |
| 885 | // When we migrate and logout |
| 886 | var m migration.MultiAccountDeprecated |
| 887 | c := cfg{cfg: authCfg.cfg} |
| 888 | require.NoError(t, c.Migrate(m)) |
| 889 | |
| 890 | require.NoError(t, authCfg.Logout(host, user)) |
| 891 | |
| 892 | // Then the host is removed from the config |
| 893 | requireNoKey(t, authCfg.cfg, []string{hostsKey, "github.com"}) |
| 894 | } |
| 895 | |
| 896 | func TestLoginInsecurePostMigrationUsesConfigForToken(t *testing.T) { |
| 897 | // Given we have not logged in |
nothing calls this directly
no test coverage detected