Browse Source

Replace context.TODO in test files with context.Background

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
pull/2/head
rht 9 years ago
parent
commit
fc3c6838fb
  1. 4
      net/swarm/swarm_test.go

4
net/swarm/swarm_test.go

@ -288,13 +288,13 @@ func TestAddrBlocking(t *testing.T) {
swarms[1].Filters.AddDialFilter(block)
swarms[1].peers.AddAddr(swarms[0].LocalPeer(), swarms[0].ListenAddresses()[0], peer.PermanentAddrTTL)
_, err = swarms[1].Dial(context.TODO(), swarms[0].LocalPeer())
_, err = swarms[1].Dial(ctx, swarms[0].LocalPeer())
if err == nil {
t.Fatal("dial should have failed")
}
swarms[0].peers.AddAddr(swarms[1].LocalPeer(), swarms[1].ListenAddresses()[0], peer.PermanentAddrTTL)
_, err = swarms[0].Dial(context.TODO(), swarms[1].LocalPeer())
_, err = swarms[0].Dial(ctx, swarms[1].LocalPeer())
if err == nil {
t.Fatal("dial should have failed")
}

Loading…
Cancel
Save