[#1138] adm/test: Use --size=1 for negative tests
All checks were successful
DCO action / DCO (pull_request) Successful in 1m24s
Vulncheck / Vulncheck (pull_request) Successful in 2m54s
Build / Build Components (1.21) (pull_request) Successful in 3m53s
Build / Build Components (1.22) (pull_request) Successful in 3m50s
Tests and linters / Staticcheck (pull_request) Successful in 4m47s
Tests and linters / gopls check (pull_request) Successful in 5m22s
Tests and linters / Lint (pull_request) Successful in 6m17s
Pre-commit hooks / Pre-commit (pull_request) Successful in 9m16s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m49s
Tests and linters / Tests (1.22) (pull_request) Successful in 10m0s
Tests and linters / Tests with -race (pull_request) Successful in 10m5s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-05-15 16:12:41 +03:00
parent 13fb312f76
commit f258046a45

View file

@ -23,8 +23,6 @@ import (
)
func TestGenerateAlphabet(t *testing.T) {
const size = 4
walletDir := t.TempDir()
buf := setupTestTerminal(t)
@ -55,13 +53,13 @@ func TestGenerateAlphabet(t *testing.T) {
t.Run("no password for contract group wallet", func(t *testing.T) {
buf.Reset()
v.Set(commonflags.AlphabetWalletsFlag, walletDir)
require.NoError(t, cmd.Flags().Set(commonflags.AlphabetSizeFlag, strconv.FormatUint(size, 10)))
for i := uint64(0); i < size; i++ {
buf.WriteString(strconv.FormatUint(i, 10) + "\r")
}
require.NoError(t, cmd.Flags().Set(commonflags.AlphabetSizeFlag, "1"))
buf.WriteString("pass\r")
require.Error(t, AlphabetCreds(cmd, nil))
})
const size = 4
buf.Reset()
v.Set(commonflags.AlphabetWalletsFlag, walletDir)
require.NoError(t, GenerateAlphabetCmd.Flags().Set(commonflags.AlphabetSizeFlag, strconv.FormatUint(size, 10)))