File: test_round_tripper.go

package info (click to toggle)
golang-testify 1.7.0%2Bgit20210824.ab6dc32-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 792 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package http

import (
	"net/http"

	"github.com/stretchr/testify/mock"
)

// TestRoundTripper DEPRECATED USE net/http/httptest
type TestRoundTripper struct {
	mock.Mock
}

// RoundTrip DEPRECATED USE net/http/httptest
func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
	args := t.Called(req)
	return args.Get(0).(*http.Response), args.Error(1)
}