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

Function TestUsersForHostWithUsers

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

Source from the content-addressed store, hash-verified

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