Skip to content

Commit

Permalink
swarm/api: Correct testserver signature for api client test (ethereum…
Browse files Browse the repository at this point in the history
  • Loading branch information
nolash authored and acud committed Apr 28, 2018
1 parent 79ac081 commit 5f78ba2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions swarm/api/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ import (
"testing"

"github.com/ethereum/go-ethereum/swarm/api"
swarmhttp "github.com/ethereum/go-ethereum/swarm/api/http"
"github.com/ethereum/go-ethereum/swarm/testutil"
)

func serverFunc(api *api.Api) testutil.TestServer {
return swarmhttp.NewServer(api)
}

// TestClientUploadDownloadRaw test uploading and downloading raw data to swarm
func TestClientUploadDownloadRaw(t *testing.T) {
testClientUploadDownloadRaw(false, t)
Expand All @@ -38,7 +43,7 @@ func TestClientUploadDownloadRawEncrypted(t *testing.T) {
}

func testClientUploadDownloadRaw(toEncrypt bool, t *testing.T) {
srv := testutil.NewTestSwarmServer(t)
srv := testutil.NewTestSwarmServer(t, serverFunc)
defer srv.Close()

client := NewClient(srv.URL)
Expand Down Expand Up @@ -79,7 +84,7 @@ func TestClientUploadDownloadFilesEncrypted(t *testing.T) {
}

func testClientUploadDownloadFiles(toEncrypt bool, t *testing.T) {
srv := testutil.NewTestSwarmServer(t)
srv := testutil.NewTestSwarmServer(t, serverFunc)
defer srv.Close()

client := NewClient(srv.URL)
Expand Down Expand Up @@ -177,7 +182,7 @@ func newTestDirectory(t *testing.T) string {
// TestClientUploadDownloadDirectory tests uploading and downloading a
// directory of files to a swarm manifest
func TestClientUploadDownloadDirectory(t *testing.T) {
srv := testutil.NewTestSwarmServer(t)
srv := testutil.NewTestSwarmServer(t, serverFunc)
defer srv.Close()

dir := newTestDirectory(t)
Expand Down Expand Up @@ -243,7 +248,7 @@ func TestClientFileListEncrypted(t *testing.T) {
}

func testClientFileList(toEncrypt bool, t *testing.T) {
srv := testutil.NewTestSwarmServer(t)
srv := testutil.NewTestSwarmServer(t, serverFunc)
defer srv.Close()

dir := newTestDirectory(t)
Expand Down Expand Up @@ -301,7 +306,7 @@ func testClientFileList(toEncrypt bool, t *testing.T) {
// TestClientMultipartUpload tests uploading files to swarm using a multipart
// upload
func TestClientMultipartUpload(t *testing.T) {
srv := testutil.NewTestSwarmServer(t)
srv := testutil.NewTestSwarmServer(t, serverFunc)
defer srv.Close()

// define an uploader which uploads testDirFiles with some data
Expand Down

0 comments on commit 5f78ba2

Please sign in to comment.