Skip to content

Commit

Permalink
test: remove TestHasBlockReturnsNil
Browse files Browse the repository at this point in the history
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@cdbe3d1
  • Loading branch information
Jorropo committed Jul 27, 2022
1 parent 931b053 commit b739af1
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions exchange/offline/offline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit b739af1

Please sign in to comment.