From 1faa2b1ebdf84f23147f2f64fa4baeabd8faa1ca Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Wed, 12 Apr 2017 20:59:55 -0500 Subject: [PATCH] swarm/api: match tests to rebase changes caused by nameresolver to uri.Immutable() migration --- swarm/api/api.go | 2 +- swarm/api/http/server_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/swarm/api/api.go b/swarm/api/api.go index 50b6660daf..26a9445d5f 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -85,7 +85,7 @@ func (self *Api) Resolve(uri *URI) (storage.Key, error) { log.Trace(fmt.Sprintf("Resolving : %v", uri.Addr)) var err error - if uri.Immutable() { + if !uri.Immutable() { if self.dns != nil { resolved, err := self.dns.Resolve(uri.Addr) if err == nil { diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index ac3bc34e25..ceb8db75bb 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -100,15 +100,15 @@ func TestBzzrGetPath(t *testing.T) { } nonhashtests := []string{ - "http://127.0.0.1:8504/bzz:/name", - "http://127.0.0.1:8504/bzzi:/nonhash", - "http://127.0.0.1:8504/bzzr:/nonhash", + srv.URL + "/bzz:/name", + srv.URL + "/bzzi:/nonhash", + srv.URL + "/bzzr:/nonhash", } nonhashresponses := []string{ - "can't resolve: 'name' does not resolve: no DNS to resolve name but is not a content hash\n", - "can't resolve: '%!s(MISSING)' is not a content hash\n", - "'nonhash' does not resolve: no DNS to resolve name but is not a content hash\n", + "error resolving name: 'name' does not resolve: no DNS to resolve name but is not a content hash\n", + "error resolving nonhash: 'nonhash' is not a content hash\n", + "error resolving nonhash: 'nonhash' does not resolve: no DNS to resolve name but is not a content hash\n", } for i, url := range nonhashtests {