2018-02-21 07:04:54 -08:00
|
|
|
package server
|
|
|
|
|
2018-02-21 07:41:56 -08:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"github.com/tendermint/tmlibs/log"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/mock"
|
2018-04-04 04:39:13 -07:00
|
|
|
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
2018-02-21 07:41:56 -08:00
|
|
|
)
|
|
|
|
|
2018-02-21 07:04:54 -08:00
|
|
|
func TestInit(t *testing.T) {
|
2018-03-09 10:36:24 -08:00
|
|
|
defer setupViper(t)()
|
2018-02-21 07:04:54 -08:00
|
|
|
|
2018-02-21 07:41:56 -08:00
|
|
|
logger := log.NewNopLogger()
|
2018-04-04 04:39:13 -07:00
|
|
|
cfg, err := tcmd.ParseConfig()
|
|
|
|
require.Nil(t, err)
|
|
|
|
ctx := NewContext(cfg, logger)
|
|
|
|
cmd := InitCmd(mock.GenInitOptions, ctx)
|
|
|
|
err = cmd.RunE(nil, nil)
|
2018-02-21 07:41:56 -08:00
|
|
|
require.NoError(t, err)
|
2018-02-21 07:04:54 -08:00
|
|
|
}
|