mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 07:26:47 +00:00
codebase: Replace !errors.Is(err, target) with testify (#1931)
* tests: Replace !errors.Is(err, target) with testify equivalents * codebase: Manual !errors.Is(err, target) replacements * typo: Replace errMisMatchedEvent with errMismatchedEvent * tests: Enhance error messages for better output * tests: Refactor error assertions in various test cases to use require and improve clarity * misc linter: Fix assert should wording * tests: Simplify assertions in TestCreateSignals for clarity and conciseness * tests: Enhance assertion message in TestCreateSignals
This commit is contained in:
@@ -2267,7 +2267,7 @@ func TestSetLeverageRate(t *testing.T) {
|
||||
MarginMode: "cross",
|
||||
InstrumentID: perpetualSwapPair.String(),
|
||||
})
|
||||
assert.True(t, err == nil || errors.Is(err, common.ErrNoResponse))
|
||||
assert.Truef(t, err == nil || errors.Is(err, common.ErrNoResponse), "SetLeverageRate should not error: %s", err)
|
||||
}
|
||||
|
||||
func TestGetMaximumBuySellAmountOROpenAmount(t *testing.T) {
|
||||
@@ -4346,9 +4346,6 @@ func TestGetCollateralMode(t *testing.T) {
|
||||
result, err := ok.GetCollateralMode(contextGenerate(), asset.Spot)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
|
||||
_, err = ok.GetCollateralMode(contextGenerate(), asset.Futures)
|
||||
assert.True(t, err == nil || errors.Is(err, asset.ErrNotSupported))
|
||||
}
|
||||
|
||||
func TestSetCollateralMode(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user