2019-02-08 12:45:23 -08:00
|
|
|
package keys
|
|
|
|
|
|
|
|
import (
|
2019-12-11 01:45:26 -08:00
|
|
|
"os"
|
2019-02-08 12:45:23 -08:00
|
|
|
"testing"
|
|
|
|
|
2019-12-11 01:45:26 -08:00
|
|
|
"github.com/spf13/viper"
|
2019-02-08 12:45:23 -08:00
|
|
|
"github.com/stretchr/testify/assert"
|
2019-12-11 01:45:26 -08:00
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
2020-01-22 09:54:56 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
2019-02-08 12:45:23 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCommands(t *testing.T) {
|
|
|
|
rootCommands := Commands()
|
|
|
|
assert.NotNil(t, rootCommands)
|
|
|
|
|
|
|
|
// Commands are registered
|
2019-09-30 08:49:12 -07:00
|
|
|
assert.Equal(t, 11, len(rootCommands.Commands()))
|
2019-02-08 12:45:23 -08:00
|
|
|
}
|
2019-12-11 01:45:26 -08:00
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2020-01-22 09:54:56 -08:00
|
|
|
viper.Set(flags.FlagKeyringBackend, keys.BackendTest)
|
2019-12-11 01:45:26 -08:00
|
|
|
os.Exit(m.Run())
|
|
|
|
}
|