Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 79d8e36

Browse files
author
postables
committed
api/v2: fix test
1 parent 3cc83cb commit 79d8e36

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

api/v2/routes_swarm_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Test_Routes_Swarm(t *testing.T) {
6363
if testRecorder.Code != 200 {
6464
t.Fatal("bad http status code recovered from /v2/swarm/upload")
6565
}
66-
var apiResp apiResponse
66+
var apiResp mapAPIResponse
6767
bodyBytes, err := ioutil.ReadAll(testRecorder.Result().Body)
6868
if err != nil {
6969
t.Fatal(err)
@@ -74,4 +74,10 @@ func Test_Routes_Swarm(t *testing.T) {
7474
if apiResp.Code != 200 {
7575
t.Fatal("bad api response status code from /v2/swarm/upload")
7676
}
77+
if apiResp.Response["swarm_hash"].(string) == "" {
78+
t.Fatal("invalid swarm hash returned")
79+
}
80+
if apiResp.Response["ipfs_hash"].(string) == "" {
81+
t.Fatal("invalid ipfs hash returned")
82+
}
7783
}

0 commit comments

Comments
 (0)