MCPcopy Index your code
hub / github.com/cli/cli / TestUsersForHostWithUsers

Function TestUsersForHostWithUsers

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

Source from the content-addressed store, hash-verified

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