diff --git a/core/coreiface/tests/block.go b/core/coreiface/tests/block.go index 7dbfa4df040..8d0243e7ee1 100644 --- a/core/coreiface/tests/block.go +++ b/core/coreiface/tests/block.go @@ -8,6 +8,7 @@ import ( "strings" "testing" + ipld "github.com/ipfs/go-ipld-format" coreiface "github.com/ipfs/interface-go-ipfs-core" opt "github.com/ipfs/interface-go-ipfs-core/options" "github.com/ipfs/interface-go-ipfs-core/path" @@ -179,7 +180,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) { if err == nil { t.Fatal("expected err to exist") } - if !strings.Contains(err.Error(), "blockservice: key not found") { + if !ipld.IsNotFound(err) { t.Errorf("unexpected error; %s", err.Error()) } @@ -187,7 +188,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) { if err == nil { t.Fatal("expected err to exist") } - if !strings.Contains(err.Error(), "blockstore: block not found") { + if !strings.Contains(err.Error(), "not found") { t.Errorf("unexpected error; %s", err.Error()) } diff --git a/core/coreiface/tests/unixfs.go b/core/coreiface/tests/unixfs.go index 4273386aaaa..f47d34d0a50 100644 --- a/core/coreiface/tests/unixfs.go +++ b/core/coreiface/tests/unixfs.go @@ -5,7 +5,6 @@ import ( "context" "encoding/hex" "fmt" - "github.com/ipfs/interface-go-ipfs-core/path" "io" "io/ioutil" "math" @@ -16,12 +15,15 @@ import ( "sync" "testing" + "github.com/ipfs/interface-go-ipfs-core/path" + coreiface "github.com/ipfs/interface-go-ipfs-core" "github.com/ipfs/interface-go-ipfs-core/options" "github.com/ipfs/go-cid" - "github.com/ipfs/go-ipfs-files" + files "github.com/ipfs/go-ipfs-files" cbor "github.com/ipfs/go-ipld-cbor" + ipld "github.com/ipfs/go-ipld-format" mdag "github.com/ipfs/go-merkledag" "github.com/ipfs/go-unixfs" "github.com/ipfs/go-unixfs/importer/helpers" @@ -576,7 +578,7 @@ func (tp *TestSuite) TestAddHashOnly(t *testing.T) { if err == nil { t.Fatal("expected an error") } - if !strings.Contains(err.Error(), "blockservice: key not found") { + if !ipld.IsNotFound(err) { t.Errorf("unxepected error: %s", err.Error()) } }