MCPcopy Index your code
hub / github.com/cli/cli / TestLoginPostMigrationSetsGitProtocol

Function TestLoginPostMigrationSetsGitProtocol

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

Source from the content-addressed store, hash-verified

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