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

Function TestLoginPostMigrationSetsGitProtocol

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

Source from the content-addressed store, hash-verified

914}
915
916func TestLoginPostMigrationSetsGitProtocol(t *testing.T) {
917 // Given we have logged in after migration
918 authCfg := newTestAuthConfig(t)
919
920 var m migration.MultiAccountDeprecated
921 c := cfg{cfg: authCfg.cfg}
922 require.NoError(t, c.Migrate(m))
923
924 _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false)
925 require.NoError(t, err)
926
927 // When we get the host git protocol
928 hostProtocol, err := authCfg.cfg.Get([]string{hostsKey, "github.com", gitProtocolKey})
929 require.NoError(t, err)
930
931 // Then it returns the git protocol we provided on login
932 require.Equal(t, "ssh", hostProtocol)
933}
934
935func TestLoginPostMigrationSetsUser(t *testing.T) {
936 // 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