cosmos-sdk/x/genutil/utils_test.go
Alessio Treglia a940214a49
testutil cleanup and reorg (#6658)
Prepare migrating testing auxiliary functions from tests
to testutil.

Remove local duplicates on testutil.WriteToNewTempFile().

Always favor testutil.NewTestCaseDir() over ioutil.TempDir().

Add test cases for the testing auxiliary functions.
2020-07-09 14:21:20 +02:00

22 lines
441 B
Go

package genutil
import (
"encoding/json"
"path/filepath"
"testing"
"time"
"github.com/cosmos/cosmos-sdk/testutil"
"github.com/stretchr/testify/require"
)
func TestExportGenesisFileWithTime(t *testing.T) {
t.Parallel()
dir, cleanup := testutil.NewTestCaseDir(t)
t.Cleanup(cleanup)
fname := filepath.Join(dir, "genesis.json")
require.NoError(t, ExportGenesisFileWithTime(fname, "test", nil, json.RawMessage(""), time.Now()))
}