mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
address CR - use dstest.Mock
License: MIT Signed-off-by: Juan Benet <juan@benet.ai>
This commit is contained in:
@ -32,13 +32,6 @@ type dagservAndPinner struct {
|
||||
mp pin.Pinner
|
||||
}
|
||||
|
||||
func getDagserv(t *testing.T) DAGService {
|
||||
db := dssync.MutexWrap(ds.NewMapDatastore())
|
||||
bs := bstore.NewBlockstore(db)
|
||||
blockserv := bserv.New(bs, offline.Exchange(bs))
|
||||
return NewDAGService(blockserv)
|
||||
}
|
||||
|
||||
func getDagservAndPinner(t *testing.T) dagservAndPinner {
|
||||
db := dssync.MutexWrap(ds.NewMapDatastore())
|
||||
bs := bstore.NewBlockstore(db)
|
||||
@ -253,7 +246,7 @@ func assertCanGet(t *testing.T, ds DAGService, n *Node) {
|
||||
}
|
||||
|
||||
func TestEmptyKey(t *testing.T) {
|
||||
ds := getDagserv(t)
|
||||
ds := dstest.Mock()
|
||||
_, err := ds.Get(context.Background(), key.Key(""))
|
||||
if err != ErrNotFound {
|
||||
t.Error("dag service should error when key is nil", err)
|
||||
|
Reference in New Issue
Block a user