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

Function failingRefresher

pkg/cmd/auth/token/token_test.go:541–547  ·  view source on GitHub ↗

failingRefresher returns a mock that always fails to refresh and records its calls.

()

Source from the content-addressed store, hash-verified

539
540// failingRefresher returns a mock that always fails to refresh and records its calls.
541func failingRefresher() *ghmock.TokenRefresherMock {
542 return &ghmock.TokenRefresherMock{
543 RefreshFunc: func(_ string, _ string) (gh.RefreshableCredential, error) {
544 return gh.RefreshableCredential{}, errors.New("token endpoint unreachable")
545 },
546 }
547}
548
549// expiredRefresher returns a mock whose refresh token is rejected by the server, recorded via
550// gh.ErrRefreshTokenInvalid, and records its calls.

Callers 1

TestTokenRunRefreshFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected