forked from LBRYCommunity/lbry-sdk
fix peer search using inexistent variable, fix test to cover it
This commit is contained in:
parent
7d2f592bb5
commit
e59e96190e
2 changed files with 1 additions and 2 deletions
|
@ -201,7 +201,6 @@ class Node:
|
||||||
try:
|
try:
|
||||||
async with peer_generator as junction:
|
async with peer_generator as junction:
|
||||||
yield junction
|
yield junction
|
||||||
await peer_generator.finished.wait()
|
|
||||||
finally:
|
finally:
|
||||||
if add_hashes_task and not (add_hashes_task.done() or add_hashes_task.cancelled()):
|
if add_hashes_task and not (add_hashes_task.done() or add_hashes_task.cancelled()):
|
||||||
add_hashes_task.cancel()
|
add_hashes_task.cancel()
|
||||||
|
|
|
@ -105,7 +105,7 @@ class TestBlobAnnouncer(AsyncioTestCase):
|
||||||
|
|
||||||
_, task = last.accumulate_peers(search_q, peer_q)
|
_, task = last.accumulate_peers(search_q, peer_q)
|
||||||
found_peers = await peer_q.get()
|
found_peers = await peer_q.get()
|
||||||
task.cancel()
|
await task
|
||||||
|
|
||||||
self.assertEqual(1, len(found_peers))
|
self.assertEqual(1, len(found_peers))
|
||||||
self.assertEqual(self.node.protocol.node_id, found_peers[0].node_id)
|
self.assertEqual(self.node.protocol.node_id, found_peers[0].node_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue