aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/storage_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/api/storage_test.go')
-rw-r--r--swarm/api/storage_test.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/swarm/api/storage_test.go b/swarm/api/storage_test.go
index d260dd61d..9d23e8f13 100644
--- a/swarm/api/storage_test.go
+++ b/swarm/api/storage_test.go
@@ -20,22 +20,24 @@ import (
"testing"
)
-func testStorage(t *testing.T, f func(*Storage)) {
- testApi(t, func(api *Api) {
- f(NewStorage(api))
+func testStorage(t *testing.T, f func(*Storage, bool)) {
+ testAPI(t, func(api *API, toEncrypt bool) {
+ f(NewStorage(api), toEncrypt)
})
}
func TestStoragePutGet(t *testing.T) {
- testStorage(t, func(api *Storage) {
+ testStorage(t, func(api *Storage, toEncrypt bool) {
content := "hello"
exp := expResponse(content, "text/plain", 0)
// exp := expResponse([]byte(content), "text/plain", 0)
- bzzhash, err := api.Put(content, exp.MimeType)
+ bzzkey, wait, err := api.Put(content, exp.MimeType, toEncrypt)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
- // to check put against the Api#Get
+ wait()
+ bzzhash := bzzkey.Hex()
+ // to check put against the API#Get
resp0 := testGet(t, api.api, bzzhash, "")
checkResponse(t, resp0, exp)