From ac193e36ce4bce752717124433a8ce84c347dbf7 Mon Sep 17 00:00:00 2001 From: holisticode Date: Fri, 8 Sep 2017 13:29:09 -0500 Subject: swarm/api/http: add error pages (#14967) --- swarm/api/http/server_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'swarm/api/http/server_test.go') diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index d3374594b..ffeaf6e0d 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -22,6 +22,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strings" "sync" "testing" @@ -110,9 +111,9 @@ func TestBzzrGetPath(t *testing.T) { } nonhashresponses := []string{ - "error resolving name: no DNS to resolve name: \"name\"\n", - "error resolving nonhash: immutable address not a content hash: \"nonhash\"\n", - "error resolving nonhash: no DNS to resolve name: \"nonhash\"\n", + "error resolving name: no DNS to resolve name: "name"", + "error resolving nonhash: immutable address not a content hash: "nonhash"", + "error resolving nonhash: no DNS to resolve name: "nonhash"", } for i, url := range nonhashtests { @@ -129,7 +130,7 @@ func TestBzzrGetPath(t *testing.T) { if err != nil { t.Fatalf("ReadAll failed: %v", err) } - if string(respbody) != nonhashresponses[i] { + if !strings.Contains(string(respbody), nonhashresponses[i]) { t.Fatalf("Non-Hash response body does not match, expected: %v, got: %v", nonhashresponses[i], string(respbody)) } } -- cgit