mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-31 23:16:54 +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:
@@ -1,7 +1,6 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -192,12 +191,8 @@ func TestLoadDataInvalid(t *testing.T) {
|
||||
dStart := time.Date(2020, 1, 0, 0, 0, 0, 0, time.UTC)
|
||||
dEnd := time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
_, err := LoadData(dStart, dEnd, gctkline.FifteenMin.Duration(), exch, -1, p, a, false)
|
||||
if !errors.Is(err, common.ErrInvalidDataType) {
|
||||
t.Errorf("received: %v, expected: %v", err, common.ErrInvalidDataType)
|
||||
}
|
||||
assert.ErrorIs(t, err, common.ErrInvalidDataType)
|
||||
|
||||
_, err = LoadData(dStart, dEnd, gctkline.FifteenMin.Duration(), exch, -1, p, a, true)
|
||||
if !errors.Is(err, errNoUSDData) {
|
||||
t.Errorf("received: %v, expected: %v", err, errNoUSDData)
|
||||
}
|
||||
assert.ErrorIs(t, err, errNoUSDData)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user