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

Function TestLoginPostMigrationSetsGitProtocol

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

Source from the content-addressed store, hash-verified

868}
869
870func TestLoginPostMigrationSetsGitProtocol(t *testing.T) {
871 // Given we have logged in after migration
872 authCfg := newTestAuthConfig(t)
873
874 var m migration.MultiAccount
875 c := cfg{authCfg.cfg}
876 require.NoError(t, c.Migrate(m))
877
878 _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false)
879 require.NoError(t, err)
880
881 // When we get the host git protocol
882 hostProtocol, err := authCfg.cfg.Get([]string{hostsKey, "github.com", gitProtocolKey})
883 require.NoError(t, err)
884
885 // Then it returns the git protocol we provided on login
886 require.Equal(t, "ssh", hostProtocol)
887}
888
889func TestLoginPostMigrationSetsUser(t *testing.T) {
890 // Given we have logged in after migration

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected