File: test_round_tripper.go

package info (click to toggle)
golang-testify 1.1.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 400 kB
  • sloc: makefile: 13
file content (17 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package http

import (
	"github.com/stretchr/testify/mock"
	"net/http"
)

// 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)
}