From b739af18ef85e7c9c667be9b4d620a3d2484bc76 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Wed, 27 Jul 2022 17:23:20 +0200 Subject: [PATCH] test: remove TestHasBlockReturnsNil The function body is just ```go return nil ``` And it's testing that this code returns nil. Pointless This commit was moved from ipfs/go-ipfs-exchange-offline@cdbe3d1b96514186d529dad54f95557b28e2fb2e --- exchange/offline/offline_test.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/exchange/offline/offline_test.go b/exchange/offline/offline_test.go index e329372b7..07ac1d001 100644 --- a/exchange/offline/offline_test.go +++ b/exchange/offline/offline_test.go @@ -4,7 +4,6 @@ import ( "context" "testing" - blocks "github.com/ipfs/go-block-format" cid "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" ds_sync "github.com/ipfs/go-datastore/sync" @@ -23,22 +22,6 @@ func TestBlockReturnsErr(t *testing.T) { t.Fail() } -func TestHasBlockReturnsNil(t *testing.T) { - store := bstore() - ex := Exchange(store) - block := blocks.NewBlock([]byte("data")) - - // we don't need to do that for the test, but that illustrate the normal workflow - if err := store.Put(context.Background(), block); err != nil { - t.Fatal(err) - } - - err := ex.NotifyNewBlocks(context.Background(), block) - if err != nil { - t.Fail() - } -} - func TestGetBlocks(t *testing.T) { store := bstore() ex := Exchange(store)