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

Function TestGitProtocolWorksRightAfterMigration

internal/config/auth_config_test.go:706–721  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected