aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http/server_test.go
diff options
context:
space:
mode:
authorholisticode <holistic.computing@gmail.com>2017-09-09 02:29:09 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-09-09 02:29:09 +0800
commitac193e36ce4bce752717124433a8ce84c347dbf7 (patch)
treeaa94c7b2db1557d05db6bb8e83828749026255cf /swarm/api/http/server_test.go
parent5ba9225fe3b06d5512976b808bc87d92d03d54ba (diff)
downloadgo-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar.gz
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar.bz2
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar.lz
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar.xz
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.tar.zst
go-tangerine-ac193e36ce4bce752717124433a8ce84c347dbf7.zip
swarm/api/http: add error pages (#14967)
Diffstat (limited to 'swarm/api/http/server_test.go')
-rw-r--r--swarm/api/http/server_test.go9
1 files changed, 5 insertions, 4 deletions
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: &#34;name&#34;",
+ "error resolving nonhash: immutable address not a content hash: &#34;nonhash&#34;",
+ "error resolving nonhash: no DNS to resolve name: &#34;nonhash&#34;",
}
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))
}
}