address CR - use dstest.Mock
License: MIT Signed-off-by: Juan Benet <juan@benet.ai>
Juan Benet committed
May 17, 2016 at 00:22 UTC
562c801976e788e091eacc41ac980f34be2d9bb8
1 file changed
+1
-8
merkledag/merkledag_test.go
+1
-8
@@ -32,13 +32,6 @@ type dagservAndPinner struct {
32
mp pin.Pinner
33
}
34
35
-func getDagserv(t *testing.T) DAGService {
36
- db := dssync.MutexWrap(ds.NewMapDatastore())
37
- bs := bstore.NewBlockstore(db)
38
- blockserv := bserv.New(bs, offline.Exchange(bs))
39
- return NewDAGService(blockserv)
40
-}
41
-
35
func getDagservAndPinner(t *testing.T) dagservAndPinner {
36
db := dssync.MutexWrap(ds.NewMapDatastore())
37
bs := bstore.NewBlockstore(db)
@@ -253,7 +246,7 @@ func assertCanGet(t *testing.T, ds DAGService, n *Node) {
246
}
247
248
func TestEmptyKey(t *testing.T) {
256
- ds := getDagserv(t)
249
+ ds := dstest.Mock()
250
_, err := ds.Get(context.Background(), key.Key(""))
251
if err != ErrNotFound {
252
t.Error("dag service should error when key is nil", err)