mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-04 13:07:46 +08:00

- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
38 lines
841 B
Go
38 lines
841 B
Go
package coreunix
|
|
|
|
import (
|
|
"os"
|
|
"path"
|
|
"testing"
|
|
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
"github.com/ipfs/go-ipfs/core"
|
|
"github.com/ipfs/go-ipfs/repo"
|
|
"github.com/ipfs/go-ipfs/repo/config"
|
|
"github.com/ipfs/go-ipfs/util/testutil"
|
|
)
|
|
|
|
func TestAddRecursive(t *testing.T) {
|
|
here, err := os.Getwd()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
r := &repo.Mock{
|
|
C: config.Config{
|
|
Identity: config.Identity{
|
|
PeerID: "Qmfoo", // required by offline node
|
|
},
|
|
},
|
|
D: testutil.ThreadSafeCloserMapDatastore(),
|
|
}
|
|
node, err := core.NewIPFSNode(context.Background(), core.Offline(r))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if k, err := AddR(node, path.Join(here, "test_data")); err != nil {
|
|
t.Fatal(err)
|
|
} else if k != "QmWCCga8AbTyfAQ7pTnGT6JgmRMAB3Qp8ZmTEFi5q5o8jC" {
|
|
t.Fatal("keys do not match")
|
|
}
|
|
}
|