diff --git a/osmoutils/cli_helpers.go b/osmoutils/cli_helpers.go index 1e9e29f8789..88b2a25a0dd 100644 --- a/osmoutils/cli_helpers.go +++ b/osmoutils/cli_helpers.go @@ -4,12 +4,10 @@ import ( "fmt" "strconv" "strings" - "testing" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) func DefaultFeeString(cfg network.Config) string { @@ -49,15 +47,3 @@ func ParseSdkIntFromString(s string, separator string) ([]sdk.Int, error) { } return parsedInts, nil } - -// ConditionalPanic checks if expectPanic is true, asserts that sut (system under test) -// panics. If expectPanic is false, asserts that sut does not panic. -// returns true if sut panics and false it it doesnot -func ConditionalPanic(t *testing.T, expectPanic bool, sut func()) { - if expectPanic { - require.Panics(t, sut) - return - } - - require.NotPanics(t, sut) -} diff --git a/osmoutils/test_helpers.go b/osmoutils/test_helpers.go new file mode 100644 index 00000000000..a331ce00c3a --- /dev/null +++ b/osmoutils/test_helpers.go @@ -0,0 +1,18 @@ +package osmoutils + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// ConditionalPanic checks if expectPanic is true, asserts that sut (system under test) +// panics. If expectPanic is false, asserts that sut does not panic. +// returns true if sut panics and false it it does not +func ConditionalPanic(t *testing.T, expectPanic bool, sut func()) { + if expectPanic { + require.Panics(t, sut) + return + } + require.NotPanics(t, sut) +}