cli/test: clean input buffer after execution

This commit is contained in:
Evgenii Stratonikov 2020-12-03 17:25:17 +03:00
parent 66402923b9
commit f4cbb1ae74
2 changed files with 4 additions and 2 deletions

View file

@ -184,7 +184,9 @@ func (e *executor) Run(t *testing.T, args ...string) {
func (e *executor) run(args ...string) error { func (e *executor) run(args ...string) error {
e.Out.Reset() e.Out.Reset()
e.Err.Reset() e.Err.Reset()
return e.CLI.Run(args) err := e.CLI.Run(args)
e.In.Reset()
return err
} }
func (e *executor) checkTxPersisted(t *testing.T, prefix ...string) (*transaction.Transaction, uint32) { func (e *executor) checkTxPersisted(t *testing.T, prefix ...string) (*transaction.Transaction, uint32) {

View file

@ -36,8 +36,8 @@ func TestSignMultisigTx(t *testing.T) {
defer os.Remove(wallet2Path) defer os.Remove(wallet2Path)
addAccount := func(w string, wif string) { addAccount := func(w string, wif string) {
e.In.WriteString("acc\rpass\rpass\r")
e.Run(t, "neo-go", "wallet", "init", "--wallet", w) e.Run(t, "neo-go", "wallet", "init", "--wallet", w)
e.In.WriteString("acc\rpass\rpass\r")
e.Run(t, "neo-go", "wallet", "import-multisig", e.Run(t, "neo-go", "wallet", "import-multisig",
"--wallet", w, "--wallet", w,
"--wif", wif, "--wif", wif,