mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 10:49:24 +08:00
Merge pull request #1695 from ipfs/fix/ipns-fuse-tests
dont use coremock for fuse tests
This commit is contained in:
@ -16,8 +16,9 @@ import (
|
|||||||
|
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
||||||
core "github.com/ipfs/go-ipfs/core"
|
core "github.com/ipfs/go-ipfs/core"
|
||||||
coremock "github.com/ipfs/go-ipfs/core/mock"
|
|
||||||
nsfs "github.com/ipfs/go-ipfs/ipnsfs"
|
nsfs "github.com/ipfs/go-ipfs/ipnsfs"
|
||||||
|
namesys "github.com/ipfs/go-ipfs/namesys"
|
||||||
|
offroute "github.com/ipfs/go-ipfs/routing/offline"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
ci "github.com/ipfs/go-ipfs/util/testutil/ci"
|
ci "github.com/ipfs/go-ipfs/util/testutil/ci"
|
||||||
)
|
)
|
||||||
@ -101,11 +102,19 @@ func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *fstest.M
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
if node == nil {
|
if node == nil {
|
||||||
node, err = coremock.NewMockNode()
|
node, err = core.NewNode(context.Background(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = node.LoadPrivateKey()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
node.Routing = offroute.NewOfflineRouter(node.Repo.Datastore(), node.PrivateKey)
|
||||||
|
node.Namesys = namesys.NewNameSystem(node.Routing)
|
||||||
|
|
||||||
ipnsfs, err := nsfs.NewFilesystem(context.Background(), node.DAG, node.Namesys, node.Pinning, node.PrivateKey)
|
ipnsfs, err := nsfs.NewFilesystem(context.Background(), node.DAG, node.Namesys, node.Pinning, node.PrivateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
Reference in New Issue
Block a user