diff --git a/coreapi/iface/tests/api.go b/coreapi/iface/tests/api.go index 1af3a83b3..0801b3ca7 100644 --- a/coreapi/iface/tests/api.go +++ b/coreapi/iface/tests/api.go @@ -9,7 +9,7 @@ import ( coreiface "github.com/ipfs/interface-go-ipfs-core" ) -var apiNotImplemented = errors.New("api not implemented") +var errAPINotImplemented = errors.New("api not implemented") func (tp *TestSuite) makeAPI(ctx context.Context) (coreiface.CoreAPI, error) { api, err := tp.MakeAPISwarm(ctx, false, 1) diff --git a/coreapi/iface/tests/block.go b/coreapi/iface/tests/block.go index 1f7252547..7dbfa4df0 100644 --- a/coreapi/iface/tests/block.go +++ b/coreapi/iface/tests/block.go @@ -32,7 +32,7 @@ func cborBlock() io.Reader { func (tp *TestSuite) TestBlock(t *testing.T) { tp.hasApi(t, func(api coreiface.CoreAPI) error { if api.Block() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/dag.go b/coreapi/iface/tests/dag.go index 2f68bbf05..6f9d9659e 100644 --- a/coreapi/iface/tests/dag.go +++ b/coreapi/iface/tests/dag.go @@ -18,7 +18,7 @@ import ( func (tp *TestSuite) TestDag(t *testing.T) { tp.hasApi(t, func(api coreiface.CoreAPI) error { if api.Dag() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/dht.go b/coreapi/iface/tests/dht.go index a957d66d7..c2e6d690f 100644 --- a/coreapi/iface/tests/dht.go +++ b/coreapi/iface/tests/dht.go @@ -13,7 +13,7 @@ import ( func (tp *TestSuite) TestDht(t *testing.T) { tp.hasApi(t, func(api iface.CoreAPI) error { if api.Dht() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/key.go b/coreapi/iface/tests/key.go index c3cd8626f..47f278f97 100644 --- a/coreapi/iface/tests/key.go +++ b/coreapi/iface/tests/key.go @@ -5,8 +5,7 @@ import ( "strings" "testing" - cid "github.com/ipfs/go-cid" - coreiface "github.com/ipfs/interface-go-ipfs-core" + "github.com/ipfs/go-cid" iface "github.com/ipfs/interface-go-ipfs-core" opt "github.com/ipfs/interface-go-ipfs-core/options" mbase "github.com/multiformats/go-multibase" @@ -15,7 +14,7 @@ import ( func (tp *TestSuite) TestKey(t *testing.T) { tp.hasApi(t, func(api iface.CoreAPI) error { if api.Key() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) @@ -67,8 +66,8 @@ func (tp *TestSuite) TestListSelf(t *testing.T) { t.Errorf("expected the key to be called 'self', got '%s'", keys[0].Name()) } - if keys[0].Path().String() != "/ipns/"+coreiface.FormatKeyID(self.ID()) { - t.Errorf("expected the key to have path '/ipns/%s', got '%s'", coreiface.FormatKeyID(self.ID()), keys[0].Path().String()) + if keys[0].Path().String() != "/ipns/"+iface.FormatKeyID(self.ID()) { + t.Errorf("expected the key to have path '/ipns/%s', got '%s'", iface.FormatKeyID(self.ID()), keys[0].Path().String()) } } @@ -185,9 +184,10 @@ func (tp *TestSuite) TestGenerateSize(t *testing.T) { } func (tp *TestSuite) TestGenerateType(t *testing.T) { + t.Skip("disabled until libp2p/specs#111 is fixed") + ctx, cancel := context.WithCancel(context.Background()) defer cancel() - t.Skip("disabled until libp2p/specs#111 is fixed") api, err := tp.makeAPI(ctx) if err != nil { diff --git a/coreapi/iface/tests/name.go b/coreapi/iface/tests/name.go index 021c1bb97..2a8b4d76a 100644 --- a/coreapi/iface/tests/name.go +++ b/coreapi/iface/tests/name.go @@ -19,7 +19,7 @@ import ( func (tp *TestSuite) TestName(t *testing.T) { tp.hasApi(t, func(api coreiface.CoreAPI) error { if api.Name() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/object.go b/coreapi/iface/tests/object.go index 2e066ca71..e8ab1a7f4 100644 --- a/coreapi/iface/tests/object.go +++ b/coreapi/iface/tests/object.go @@ -15,7 +15,7 @@ import ( func (tp *TestSuite) TestObject(t *testing.T) { tp.hasApi(t, func(api iface.CoreAPI) error { if api.Object() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/pin.go b/coreapi/iface/tests/pin.go index 476bbea6b..d378d1015 100644 --- a/coreapi/iface/tests/pin.go +++ b/coreapi/iface/tests/pin.go @@ -18,7 +18,7 @@ import ( func (tp *TestSuite) TestPin(t *testing.T) { tp.hasApi(t, func(api iface.CoreAPI) error { if api.Pin() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/pubsub.go b/coreapi/iface/tests/pubsub.go index 36353f836..f8339f228 100644 --- a/coreapi/iface/tests/pubsub.go +++ b/coreapi/iface/tests/pubsub.go @@ -12,7 +12,7 @@ import ( func (tp *TestSuite) TestPubSub(t *testing.T) { tp.hasApi(t, func(api iface.CoreAPI) error { if api.PubSub() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) diff --git a/coreapi/iface/tests/unixfs.go b/coreapi/iface/tests/unixfs.go index 1ed80e873..4273386aa 100644 --- a/coreapi/iface/tests/unixfs.go +++ b/coreapi/iface/tests/unixfs.go @@ -31,7 +31,7 @@ import ( func (tp *TestSuite) TestUnixfs(t *testing.T) { tp.hasApi(t, func(api coreiface.CoreAPI) error { if api.Unixfs() == nil { - return apiNotImplemented + return errAPINotImplemented } return nil }) @@ -1035,8 +1035,7 @@ func (tp *TestSuite) TestGetReadAt(t *testing.T) { origR := bytes.NewReader(orig) - r, err = api.Unixfs().Get(ctx, p) - if err != nil { + if _, err := api.Unixfs().Get(ctx, p); err != nil { t.Fatal(err) }