提交 25b36d10 作者: Jeromy

moved mock core node to core package

上级 c64add19
package testutil package core
import ( import (
ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go" ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
syncds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go/sync" syncds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go/sync"
bs "github.com/jbenet/go-ipfs/blockservice" bs "github.com/jbenet/go-ipfs/blockservice"
core "github.com/jbenet/go-ipfs/core"
ci "github.com/jbenet/go-ipfs/crypto" ci "github.com/jbenet/go-ipfs/crypto"
mdag "github.com/jbenet/go-ipfs/merkledag" mdag "github.com/jbenet/go-ipfs/merkledag"
nsys "github.com/jbenet/go-ipfs/namesys" nsys "github.com/jbenet/go-ipfs/namesys"
...@@ -12,10 +11,8 @@ import ( ...@@ -12,10 +11,8 @@ import (
mdht "github.com/jbenet/go-ipfs/routing/mock" mdht "github.com/jbenet/go-ipfs/routing/mock"
) )
var _ = core.IpfsNode{} func NewMockNode() (*IpfsNode, error) {
nd := new(IpfsNode)
func NewMockNode() (*core.IpfsNode, error) {
nd := new(core.IpfsNode)
//Generate Identity //Generate Identity
nd.Identity = &peer.Peer{ID: []byte("TESTING")} nd.Identity = &peer.Peer{ID: []byte("TESTING")}
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"testing" "testing"
fstest "github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs/fstestutil" fstest "github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs/fstestutil"
testutil "github.com/jbenet/go-ipfs/util/testutil" "github.com/jbenet/go-ipfs/core"
) )
func randBytes(size int) []byte { func randBytes(size int) []byte {
...@@ -18,7 +18,7 @@ func randBytes(size int) []byte { ...@@ -18,7 +18,7 @@ func randBytes(size int) []byte {
} }
func TestIpnsBasicIO(t *testing.T) { func TestIpnsBasicIO(t *testing.T) {
localnode, err := testutil.NewMockNode() localnode, err := core.NewMockNode()
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论