MCPcopy Create free account
hub / github.com/cli/cli / TestUserWorksRightAfterMigration

Function TestUserWorksRightAfterMigration

internal/config/auth_config_test.go:707–722  ·  view source on GitHub ↗

Post migration tests

(t *testing.T)

Source from the content-addressed store, hash-verified

705// Post migration tests
706
707func TestUserWorksRightAfterMigration(t *testing.T) {
708 // Given we have logged in before migration
709 authCfg := newTestAuthConfig(t)
710 _, err := preMigrationLogin(authCfg, "github.com", "test-user", "test-token", "ssh", false)
711 require.NoError(t, err)
712
713 // When we migrate
714 var m migration.MultiAccountDeprecated
715 c := cfg{cfg: authCfg.cfg}
716 require.NoError(t, c.Migrate(m))
717
718 // Then we can still get the user correctly
719 user, err := authCfg.ActiveUser("github.com")
720 require.NoError(t, err)
721 require.Equal(t, "test-user", user)
722}
723
724func TestGitProtocolWorksRightAfterMigration(t *testing.T) {
725 // Given we have logged in before migration with a non-default git protocol

Callers

nothing calls this directly

Calls 5

MigrateMethod · 0.95
newTestAuthConfigFunction · 0.85
preMigrationLoginFunction · 0.85
EqualMethod · 0.80
ActiveUserMethod · 0.65

Tested by

no test coverage detected