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

Function TestUsersForHostWithUsers

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

Source from the content-addressed store, hash-verified

628}
629
630func TestUsersForHostWithUsers(t *testing.T) {
631 // Given we have a config with a host and users
632 authCfg := newTestAuthConfig(t)
633 _, err := authCfg.Login("github.com", "test-user-1", "test-token", "ssh", false)
634 require.NoError(t, err)
635 _, err = authCfg.Login("github.com", "test-user-2", "test-token", "ssh", false)
636 require.NoError(t, err)
637
638 // When we get the users for that host
639 users := authCfg.UsersForHost("github.com")
640
641 // Then it succeeds and returns the users
642 require.Equal(t, []string{"test-user-1", "test-user-2"}, users)
643}
644
645func TestTokenForUserSecureLogin(t *testing.T) {
646 // 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