MCPcopy
hub / github.com/cli/cli / TestLoginSetsUserForProvidedHost

Function TestLoginSetsUserForProvidedHost

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

Source from the content-addressed store, hash-verified

301}
302
303func TestLoginSetsUserForProvidedHost(t *testing.T) {
304 // Given we are not logged in
305 authCfg := newTestAuthConfig(t)
306
307 // When we login
308 _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false)
309
310 // Then it returns success and the user is set
311 require.NoError(t, err)
312
313 user, err := authCfg.ActiveUser("github.com")
314 require.NoError(t, err)
315 require.Equal(t, "test-user", user)
316}
317
318func TestLoginSetsGitProtocolForProvidedHost(t *testing.T) {
319 // Given we are logged in

Callers

nothing calls this directly

Calls 4

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
LoginMethod · 0.65
ActiveUserMethod · 0.65

Tested by

no test coverage detected