Merge pull request #24 from filecoin-project/test/fsrepo
Add more tests to repo
This commit is contained in:
commit
9b1843fcfd
@ -62,7 +62,7 @@ func (fsr *FsRepo) Init() error {
|
||||
|
||||
log.Infof("Initializing repo at '%s'", fsr.path)
|
||||
|
||||
return os.Mkdir(fsr.path, 0755) // nolint
|
||||
return os.Mkdir(fsr.path, 0755) //nolint: gosec
|
||||
}
|
||||
|
||||
// APIEndpoint returns endpoint of API in this repo
|
||||
|
@ -5,6 +5,8 @@ import (
|
||||
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/node/config"
|
||||
)
|
||||
|
||||
func basicTest(t *testing.T, repo Repo) {
|
||||
@ -43,6 +45,14 @@ func basicTest(t *testing.T, repo Repo) {
|
||||
assert.NoError(t, err, "setting multiaddr shouldn't error")
|
||||
assert.Equal(t, ma, apima, "returned API multiaddr should be the same")
|
||||
|
||||
iden, err := lrepo.Libp2pIdentity()
|
||||
assert.NotNil(t, iden, "identity is not nil")
|
||||
assert.NoError(t, err, "identity should not error")
|
||||
|
||||
cfg, err := lrepo.Config()
|
||||
assert.Equal(t, config.Default(), cfg, "there should be a default config")
|
||||
assert.NoError(t, err, "config should not error")
|
||||
|
||||
err = lrepo.Close()
|
||||
assert.NoError(t, err, "should be able to close")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user