swarm/api/http: added a regression test for resolver bug from #17483 (#17502)

This commit is contained in:
Elad
2018-09-06 12:08:39 +02:00
committed by Balint Gabor
parent 5918b88a8f
commit 4c15ffffdd
4 changed files with 148 additions and 23 deletions

View File

@ -45,7 +45,7 @@ func (f *fakeTimeProvider) Now() mru.Timestamp {
return mru.Timestamp{Time: f.currentTime}
}
func NewTestSwarmServer(t *testing.T, serverFunc func(*api.API) TestServer) *TestSwarmServer {
func NewTestSwarmServer(t *testing.T, serverFunc func(*api.API) TestServer, resolver api.Resolver) *TestSwarmServer {
dir, err := ioutil.TempDir("", "swarm-storage-test")
if err != nil {
t.Fatal(err)
@ -77,7 +77,7 @@ func NewTestSwarmServer(t *testing.T, serverFunc func(*api.API) TestServer) *Tes
t.Fatal(err)
}
a := api.NewAPI(fileStore, nil, rh.Handler, nil)
a := api.NewAPI(fileStore, resolver, rh.Handler, nil)
srv := httptest.NewServer(serverFunc(a))
return &TestSwarmServer{
Server: srv,