...

Source file src/github.com/stretchr/testify/http/test_round_tripper.go

Documentation: github.com/stretchr/testify/http

     1  package http
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/stretchr/testify/mock"
     7  )
     8  
     9  // Deprecated: Use [net/http/httptest] instead.
    10  type TestRoundTripper struct {
    11  	mock.Mock
    12  }
    13  
    14  // Deprecated: Use [net/http/httptest] instead.
    15  func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
    16  	args := t.Called(req)
    17  	return args.Get(0).(*http.Response), args.Error(1)
    18  }
    19  

View as plain text