88 "github.com/gogo/protobuf/proto"
99 ipns_pb "github.com/ipfs/go-ipns/pb"
1010 iface "github.com/ipfs/interface-go-ipfs-core"
11+ "github.com/ipfs/interface-go-ipfs-core/path"
1112)
1213
1314func (tp * TestSuite ) TestRouting (t * testing.T ) {
@@ -48,9 +49,10 @@ func (tp *TestSuite) TestRoutingGet(t *testing.T) {
4849
4950 // Node 1: publishes an IPNS name
5051 ipnsEntry := tp .testRoutingPublishKey (t , ctx , apis [0 ])
52+ ipnsPath := path .Join (path .New ("/ipns" ), ipnsEntry .Name ())
5153
5254 // Node 2: retrieves the best value for the IPNS name.
53- data , err := apis [1 ].Routing ().Get (ctx , "/ipns/" + ipnsEntry . Name () )
55+ data , err := apis [1 ].Routing ().Get (ctx , ipnsPath )
5456 if err != nil {
5557 t .Fatal (err )
5658 }
@@ -77,15 +79,16 @@ func (tp *TestSuite) TestRoutingPut(t *testing.T) {
7779
7880 // Create and publish IPNS entry.
7981 ipnsEntry := tp .testRoutingPublishKey (t , ctx , apis [0 ])
82+ ipnsPath := path .Join (path .New ("/ipns" ), ipnsEntry .Name ())
8083
8184 // Get valid routing value.
82- data , err := apis [0 ].Routing ().Get (ctx , "/ipns/" + ipnsEntry . Name () )
85+ data , err := apis [0 ].Routing ().Get (ctx , ipnsPath )
8386 if err != nil {
8487 t .Fatal (err )
8588 }
8689
8790 // Put routing value.
88- err = apis [0 ].Routing ().Put (ctx , "/ipns/" + ipnsEntry . Name () , data )
91+ err = apis [0 ].Routing ().Put (ctx , ipnsPath , data )
8992 if err != nil {
9093 t .Fatal (err )
9194 }
0 commit comments