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

Function TestLoginSetsUserForProvidedHost

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

Source from the content-addressed store, hash-verified

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