Merge remote-tracking branch 'origin/master' into feat/post-worker
This commit is contained in:
@@ -2,16 +2,11 @@
|
||||
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)
|
||||
}
|
||||
func genFsRepo(t *testing.T) *FsRepo {
|
||||
path := t.TempDir()
|
||||
|
||||
repo, err := NewFS(path)
|
||||
if err != nil {
|
||||
@@ -22,13 +17,15 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) {
|
||||
if err != ErrRepoExists && err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return repo, func() {
|
||||
_ = os.RemoveAll(path)
|
||||
}
|
||||
return repo
|
||||
}
|
||||
|
||||
func TestFsBasic(t *testing.T) {
|
||||
repo, closer := genFsRepo(t)
|
||||
defer closer()
|
||||
//stm: @NODE_FS_REPO_LOCK_001,@NODE_FS_REPO_LOCK_002,@NODE_FS_REPO_UNLOCK_001
|
||||
//stm: @NODE_FS_REPO_SET_API_ENDPOINT_001, @NODE_FS_REPO_GET_API_ENDPOINT_001
|
||||
//stm: @NODE_FS_REPO_GET_CONFIG_001, @NODE_FS_REPO_SET_CONFIG_001
|
||||
//stm: @NODE_FS_REPO_LIST_KEYS_001, @NODE_FS_REPO_PUT_KEY_001
|
||||
//stm: @NODE_FS_REPO_GET_KEY_001, NODE_FS_REPO_DELETE_KEY_001
|
||||
repo := genFsRepo(t)
|
||||
basicTest(t, repo)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func TestMemBasic(t *testing.T) {
|
||||
//stm: @REPO_MEM_001
|
||||
repo := NewMemory(nil)
|
||||
basicTest(t, repo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user