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.
This commit is contained in:
Alessio Treglia
2020-07-09 14:21:20 +02:00
committed by GitHub
parent f8df05f6f1
commit a940214a49
44 changed files with 281 additions and 243 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/tests"
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
@@ -35,7 +35,7 @@ func TestGetCommandEncode(t *testing.T) {
JSONEncoded, err := txGen.TxJSONEncoder()(stdTx)
require.NoError(t, err)
txFile, cleanup := tests.WriteToNewTempFile(t, string(JSONEncoded))
txFile, cleanup := testutil.WriteToNewTempFile(t, string(JSONEncoded))
txFileName := txFile.Name()
t.Cleanup(cleanup)