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

Function TestLoginSetsUserForProvidedHost

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

Source from the content-addressed store, hash-verified

317}
318
319func TestLoginSetsUserForProvidedHost(t *testing.T) {
320 // Given we are not logged in
321 authCfg := newTestAuthConfig(t)
322
323 // When we login
324 _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false)
325
326 // Then it returns success and the user is set
327 require.NoError(t, err)
328
329 user, err := authCfg.ActiveUser("github.com")
330 require.NoError(t, err)
331 require.Equal(t, "test-user", user)
332}
333
334func TestLoginSetsGitProtocolForProvidedHost(t *testing.T) {
335 // 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