From 9b2f55a098ba49c2a9a79eb4e677afe8ab80a504 Mon Sep 17 00:00:00 2001 From: Daniel Czerwonk <daniel@dan-nrw.de> Date: Mon, 25 Jun 2018 09:46:44 +0200 Subject: [PATCH] redone helper_test tests --- routingtable/filter/helper_test.go | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/routingtable/filter/helper_test.go b/routingtable/filter/helper_test.go index 5d82727a..19a444d4 100644 --- a/routingtable/filter/helper_test.go +++ b/routingtable/filter/helper_test.go @@ -1,27 +1,23 @@ package filter -/*func TestNewAcceptAllFilter(t *testing.T) { - f := NewAcceptAllFilter() +import ( + "testing" - m := &clientMock{} - f.Register(m) + "github.com/bio-routing/bio-rd/net" + "github.com/bio-routing/bio-rd/route" + "github.com/stretchr/testify/assert" +) - f.AddPath(net.NewPfx(0, 0), &route.Path{}) +func TestNewAcceptAllFilter(t *testing.T) { + f := NewAcceptAllFilter() - if !m.addPathCalled { - t.Fatalf("expected accepted, but was filtered") - } + _, reject := f.ProcessTerms(net.NewPfx(0, 0), &route.Path{}) + assert.Equal(t, false, reject) } func TestNewDrainFilter(t *testing.T) { f := NewDrainFilter() - m := &clientMock{} - f.Register(m) - - f.AddPath(net.NewPfx(0, 0), &route.Path{}) - - if m.addPathCalled { - t.Fatalf("expected filtered, but was accepted") - } -}*/ + _, reject := f.ProcessTerms(net.NewPfx(0, 0), &route.Path{}) + assert.Equal(t, true, reject) +} -- GitLab