From 79d8e367d53386ffa3cc303a480196adb337b059 Mon Sep 17 00:00:00 2001 From: postables Date: Sun, 5 Apr 2020 22:31:13 -0700 Subject: [PATCH] api/v2: fix test --- api/v2/routes_swarm_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/v2/routes_swarm_test.go b/api/v2/routes_swarm_test.go index fcb7d60a9..5430e6f4c 100644 --- a/api/v2/routes_swarm_test.go +++ b/api/v2/routes_swarm_test.go @@ -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) @@ -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") + } }