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