Ok, I figured out the basic problem. I had neglected to configure the
server url in the httpclient object used by both the CUT and the test, so
the request wasn't being sent to the mock server or the mock handler.
Thanks for the responses. Some of that will be useful anyway. I didn't
realize th
Hi, David, I'm no expert on http std. But the following testcase based on
the httptest unittest code works. I think the key point is to use '
client.Get(server.URL)' to invoke a request.
Hope it helps.
import "testing"
import "os"
import "net/http"
import "net/http/httptest"
func TestProcessProj
A little while ago, I was able to write some unit tests for some code that
makes an http connection. I created a mockserver and a client using that
server. That test in that application works fine.
I'm now trying to do basically the same thing in a different application.
I'm trying to start wi