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

Function TestLoginSetsUserForProvidedHost

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

Source from the content-addressed store, hash-verified

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