(t *testing.T)
| 933 | } |
| 934 | |
| 935 | func TestLoginPostMigrationSetsUser(t *testing.T) { |
| 936 | // Given we have logged in after migration |
| 937 | authCfg := newTestAuthConfig(t) |
| 938 | |
| 939 | var m migration.MultiAccountDeprecated |
| 940 | c := cfg{cfg: authCfg.cfg} |
| 941 | require.NoError(t, c.Migrate(m)) |
| 942 | |
| 943 | _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false) |
| 944 | require.NoError(t, err) |
| 945 | |
| 946 | // When we get the user |
| 947 | user, err := authCfg.ActiveUser("github.com") |
| 948 | |
| 949 | // Then it returns success and the user we provided on login |
| 950 | require.NoError(t, err) |
| 951 | require.Equal(t, "test-user", user) |
| 952 | } |
| 953 | |
| 954 | func TestLoginSecurePostMigrationRemovesTokenFromConfig(t *testing.T) { |
| 955 | // Given we have logged in insecurely |
nothing calls this directly
no test coverage detected