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

Function TestUsersForHostWithUsers

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

Source from the content-addressed store, hash-verified

612}
613
614func TestUsersForHostWithUsers(t *testing.T) {
615 // Given we have a config with a host and users
616 authCfg := newTestAuthConfig(t)
617 _, err := authCfg.Login("github.com", "test-user-1", "test-token", "ssh", false)
618 require.NoError(t, err)
619 _, err = authCfg.Login("github.com", "test-user-2", "test-token", "ssh", false)
620 require.NoError(t, err)
621
622 // When we get the users for that host
623 users := authCfg.UsersForHost("github.com")
624
625 // Then it succeeds and returns the users
626 require.Equal(t, []string{"test-user-1", "test-user-2"}, users)
627}
628
629func TestTokenForUserSecureLogin(t *testing.T) {
630 // Given a user has logged in securely

Callers

nothing calls this directly

Calls 4

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
LoginMethod · 0.65
UsersForHostMethod · 0.65

Tested by

no test coverage detected