Replacing custom testing helpers with testify, where possible
This commit is contained in:
1 parent
21e07c0db9
commit
cdee7a5d6f
24 files changed
+509
-607
No files matched your search
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"github.com/stretchr/testify/require"
|
||||
. "github.com/weaveworks/weave/common"
|
||||
wt "github.com/weaveworks/weave/testing"
|
||||
)
|
||||
|
||||
// Check that we can prune an answer
|
||||
@@ -29,11 +29,11 @@ func TestPrune(t *testing.T) {
|
||||
reply.Answer[0].Header().Ttl = DefaultLocalTTL
|
||||
|
||||
pruned := pruneAnswers(reply.Answer, 1)
|
||||
wt.AssertEqualInt(t, len(pruned), 1, "wrong number of answers")
|
||||
require.Equal(t, 1, len(pruned), "wrong number of answers")
|
||||
|
||||
pruned = pruneAnswers(reply.Answer, 2)
|
||||
wt.AssertEqualInt(t, len(pruned), 2, "wrong number of answers")
|
||||
require.Equal(t, 2, len(pruned), "wrong number of answers")
|
||||
|
||||
pruned = pruneAnswers(reply.Answer, 0)
|
||||
wt.AssertEqualInt(t, len(pruned), len(records), "wrong number of answers")
|
||||
require.Equal(t, len(records), len(pruned), "wrong number of answers")
|
||||
}
|
||||
Reference in new issue
Block a user