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

Commit

Permalink
api/v2: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
postables committed Apr 6, 2020
1 parent 3cc83cb commit 79d8e36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/v2/routes_swarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Test_Routes_Swarm(t *testing.T) {
if testRecorder.Code != 200 {
t.Fatal("bad http status code recovered from /v2/swarm/upload")
}
var apiResp apiResponse
var apiResp mapAPIResponse
bodyBytes, err := ioutil.ReadAll(testRecorder.Result().Body)
if err != nil {
t.Fatal(err)
Expand All @@ -74,4 +74,10 @@ func Test_Routes_Swarm(t *testing.T) {
if apiResp.Code != 200 {
t.Fatal("bad api response status code from /v2/swarm/upload")
}
if apiResp.Response["swarm_hash"].(string) == "" {
t.Fatal("invalid swarm hash returned")
}
if apiResp.Response["ipfs_hash"].(string) == "" {
t.Fatal("invalid ipfs hash returned")
}
}

0 comments on commit 79d8e36

Please sign in to comment.