block cmd: go-path update
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Aug 2, 2018 at 18:06 UTC
c3e69073e52d15358a556c39cae2380cd12bee67
1 file changed
+14
core/coreapi/block_test.go
+14
@@ -6,6 +6,7 @@ import (
6
"strings"
7
"testing"
8
9
+ coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
10
opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
11
12
mh "gx/ipfs/QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8/go-multihash"
@@ -87,6 +88,19 @@ func TestBlockGet(t *testing.T) {
88
if string(d) != "Hello" {
89
t.Error("didn't get correct data back")
90
}
91
+
92
+ p, err := coreiface.ParsePath("/ipfs/" + res.Path().Cid().String())
93
+ if err != nil {
94
+ t.Error(err)
95
+ }
96
+
97
+ rp, err := api.ResolvePath(ctx, p)
98
+ if err != nil {
99
+ t.Fatal(err)
100
+ }
101
+ if rp.Cid().String() != res.Path().Cid().String() {
102
+ t.Error("paths didn't match")
103
+ }
104
}
105
106
func TestBlockRm(t *testing.T) {