From 3ff2f756368f2d8ec0d1d9d25f6ba9cdabd7383e Mon Sep 17 00:00:00 2001 From: Balint Gabor Date: Thu, 13 Sep 2018 11:42:19 +0200 Subject: swarm: Chunk refactor (#17659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Janos Guljas Co-authored-by: Balint Gabor Co-authored-by: Anton Evangelatov Co-authored-by: Viktor TrĂ³n --- swarm/fuse/swarmfs_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'swarm/fuse/swarmfs_test.go') diff --git a/swarm/fuse/swarmfs_test.go b/swarm/fuse/swarmfs_test.go index 6efeb78d9..87d918550 100644 --- a/swarm/fuse/swarmfs_test.go +++ b/swarm/fuse/swarmfs_test.go @@ -20,7 +20,6 @@ package fuse import ( "bytes" - "context" "crypto/rand" "flag" "fmt" @@ -111,7 +110,7 @@ func createTestFilesAndUploadToSwarm(t *testing.T, api *api.API, files map[strin } //upload directory to swarm and return hash - bzzhash, err := api.Upload(context.TODO(), uploadDir, "", toEncrypt) + bzzhash, err := Upload(uploadDir, "", api, toEncrypt) if err != nil { t.Fatalf("Error uploading directory %v: %vm encryption: %v", uploadDir, err, toEncrypt) } @@ -1695,3 +1694,9 @@ func TestFUSE(t *testing.T) { t.Run("appendFileContentsToEndNonEncrypted", ta.appendFileContentsToEndNonEncrypted) } } + +func Upload(uploadDir, index string, a *api.API, toEncrypt bool) (hash string, err error) { + fs := api.NewFileSystem(a) + hash, err = fs.Upload(uploadDir, index, toEncrypt) + return hash, err +} -- cgit