fetchall: simplify multiple urls test.
This commit is contained in:
parent
91f9796dad
commit
901371904b
1 changed files with 10 additions and 13 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue