lotus/node/repo/fsrepo_test.go
Jakub Sztandera 902ea18686 Add keystore to the repo
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-07-18 16:01:39 +02:00

34 lines
484 B
Go

package repo
import (
"io/ioutil"
"os"
"testing"
)
func genFsRepo(t *testing.T) (*FsRepo, func()) {
path, err := ioutil.TempDir("", "lotus-repo-")
if err != nil {
t.Fatal(err)
}
repo, err := NewFS(path)
if err != nil {
t.Fatal(err)
}
err = repo.Init()
if err != ErrRepoExists && err != nil {
t.Fatal(err)
}
return repo, func() {
_ = os.RemoveAll(path)
}
}
func TestFsBasic(t *testing.T) {
repo, closer := genFsRepo(t)
defer closer()
basicTest(t, repo)
}