mirror of
https://github.com/stretchr/testify.git
synced 2025-07-09 03:59:17 +00:00
added test round tripper
This commit is contained in:
parent
ba887bba64
commit
5f6413d60a
15
http/test_round_tripper.go
Normal file
15
http/test_round_tripper.go
Normal file
@ -0,0 +1,15 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/mock"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type TestRoundTripper struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
args := t.Called(req)
|
||||
return args.Get(0).(*http.Response), args.Error(1)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user