fetchall: simplify multiple urls test.

This commit is contained in:
Arseny Balobanov 2020-02-15 17:57:04 +03:00
parent 91f9796dad
commit 901371904b

View file

@ -84,7 +84,6 @@ func TestFetchall_multipleURLs(t *testing.T) {
var fooHit, barHit int32
h := func(w http.ResponseWriter, r *http.Request) {
mux := http.NewServeMux()
mux.HandleFunc("/foo", func(w http.ResponseWriter, h *http.Request) {
atomic.StoreInt32(&fooHit, 1)
@ -94,10 +93,8 @@ func TestFetchall_multipleURLs(t *testing.T) {
atomic.StoreInt32(&barHit, 1)
_, _ = w.Write([]byte("bar"))
})
mux.ServeHTTP(w, r)
}
s := httptest.NewServer(http.HandlerFunc(h))
s := httptest.NewServer(mux)
defer s.Close()
cmd := exec.Command(binary, s.URL+"/foo", s.URL+"/bar")