Closed panamafrancis closed 5 years ago
We use httpmock when testing appengine. We create a MockTransport using https://godoc.org/github.com/jarcoal/httpmock#NewMockTransport and then we put it in the context.Context and have some wrapper code that extracts a client from the context. If a MockTransport has been added it is used if not the default client from appengine is used.
Works like a charm! However it is necessary to use the new, go gettable, appengine packages.
@panamafrancis Is this issue still unresolved for you?
I've moved on and no longer work on AppEngine, but i'm guessing this would still affect appengine users. however the comment 2 above looks like a reasonable workaround.
for reference #10 was the PR
Seems this issue won't progress now. Please comment or re-open if the solution of @gabrielf is not OK.
http.DefaultTransport is hardcoded, this prevents httpmock from being used with some libraries like appengine/urlfetch which doesn't use http.DefaultTransport.