1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

refactor(routing) use routing.ErrNotFound

This commit is contained in:
Brian Tiger Chow
2014-10-28 02:17:46 -07:00
parent f75f4a4b6d
commit 321eb421e7
4 changed files with 13 additions and 9 deletions

View File

@ -12,6 +12,7 @@ import (
msg "github.com/jbenet/go-ipfs/net/message"
mux "github.com/jbenet/go-ipfs/net/mux"
peer "github.com/jbenet/go-ipfs/peer"
"github.com/jbenet/go-ipfs/routing"
pb "github.com/jbenet/go-ipfs/routing/dht/pb"
u "github.com/jbenet/go-ipfs/util"
@ -145,7 +146,7 @@ func TestGetFailures(t *testing.T) {
ctx2, _ := context.WithTimeout(context.Background(), time.Second)
_, err = d.GetValue(ctx2, u.Key("test"))
if err != nil {
if err != u.ErrNotFound {
if err != routing.ErrNotFound {
t.Fatalf("Expected ErrNotFound, got: %s", err)
}
} else {
@ -247,7 +248,7 @@ func TestNotFound(t *testing.T) {
log.Debug("get value got %v", v)
if err != nil {
switch err {
case u.ErrNotFound:
case routing.ErrNotFound:
//Success!
return
case u.ErrTimeout:
@ -311,7 +312,7 @@ func TestLessThanKResponses(t *testing.T) {
_, err := d.GetValue(ctx, u.Key("hello"))
if err != nil {
switch err {
case u.ErrNotFound:
case routing.ErrNotFound:
//Success!
return
case u.ErrTimeout: