mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Update tests to use ipld.IsNotFound to check for notfound errors
This commit was moved from ipfs/interface-go-ipfs-core@01ee9419a2 This commit was moved from ipfs/boxo@2263eca4a4
This commit is contained in:
parent
a83f5e6df0
commit
49e2b34be5
@ -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())
|
||||
}
|
||||
|
||||
|
||||
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user