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

Method RoundTrip

internal/authflow/refresh_test.go:26–42  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

24}
25
26func (s *stubRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
27 s.lastReq = req
28 if req.Body != nil {
29 data, _ := io.ReadAll(req.Body)
30 s.lastBody = string(data)
31 }
32 status := s.status
33 if status == 0 {
34 status = http.StatusOK
35 }
36 return &http.Response{
37 StatusCode: status,
38 Header: http.Header{"Content-Type": {"application/x-www-form-urlencoded; charset=utf-8"}},
39 Body: io.NopCloser(strings.NewReader(s.body)),
40 Request: req,
41 }, nil
42}
43
44func TestTokenRefresherRefresh(t *testing.T) {
45 // Pin a non-UTC clock so the test proves the derived expiry is normalized to UTC rather than inheriting the

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected