diff options
Diffstat (limited to 'tpl/data/data_test.go')
-rw-r--r-- | tpl/data/data_test.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/tpl/data/data_test.go b/tpl/data/data_test.go index 9ef969244..7a0640e95 100644 --- a/tpl/data/data_test.go +++ b/tpl/data/data_test.go @@ -21,8 +21,6 @@ import ( "strings" "testing" - jww "github.com/spf13/jwalterweatherman" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -110,13 +108,13 @@ func TestGetCSV(t *testing.T) { // Get on with it got, err := ns.GetCSV(test.sep, test.url) - require.NoError(t, err, msg) - if _, ok := test.expect.(bool); ok { - require.Equal(t, 1, int(ns.deps.Log.ErrorCounter.Count())) + require.Error(t, err, msg) require.Nil(t, got) continue } + + require.NoError(t, err, msg) require.Equal(t, 0, int(ns.deps.Log.ErrorCounter.Count())) require.NotNil(t, got, msg) @@ -140,12 +138,12 @@ func TestGetJSON(t *testing.T) { { `http://malformed/`, `{gomeetup:["Sydney","San Francisco","Stockholm"]}`, - jww.LevelError, + false, }, { `http://nofound/404`, ``, - jww.LevelError, + false, }, // Locals { @@ -156,7 +154,7 @@ func TestGetJSON(t *testing.T) { { "fail/no-file", "", - jww.LevelError, + false, }, } { @@ -198,13 +196,6 @@ func TestGetJSON(t *testing.T) { continue } - if errLevel, ok := test.expect.(jww.Threshold); ok && errLevel >= jww.LevelError { - logCount := ns.deps.Log.ErrorCounter.Count() - require.True(t, logCount >= 1, fmt.Sprintf("got log count %d", logCount)) - continue - } - require.NoError(t, err, msg) - require.Equal(t, 0, int(ns.deps.Log.ErrorCounter.Count()), msg) require.NotNil(t, got, msg) |