aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/fuse/swarmfs_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/fuse/swarmfs_test.go')
-rw-r--r--swarm/fuse/swarmfs_test.go9
1 files changed, 7 insertions, 2 deletions
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
+}