forked from LBRYCommunity/lbry-sdk
update test
This commit is contained in:
parent
bf5b5f43e3
commit
111871bb28
2 changed files with 3 additions and 0 deletions
|
@ -107,12 +107,14 @@ class BlobServerProtocol(asyncio.Protocol):
|
|||
else:
|
||||
self.close()
|
||||
log.debug("stopped sending %s to %s:%i", blob_hash, peer_address, peer_port)
|
||||
return
|
||||
except (OSError, ValueError, asyncio.TimeoutError) as err:
|
||||
if isinstance(err, asyncio.TimeoutError):
|
||||
log.debug("timed out sending blob %s to %s", blob_hash, peer_address)
|
||||
else:
|
||||
log.warning("could not read blob %s to send %s:%i", blob_hash, peer_address, peer_port)
|
||||
self.close()
|
||||
return
|
||||
finally:
|
||||
self.transfer_finished.set()
|
||||
else:
|
||||
|
|
|
@ -219,6 +219,7 @@ class TestBlobExchange(BlobExchangeTestBase):
|
|||
server_protocol = BlobServerProtocol(self.loop, self.server_blob_manager, self.server.lbrycrd_address)
|
||||
transport = asyncio.Transport(extra={'peername': ('ip', 90)})
|
||||
received_data = BytesIO()
|
||||
transport.is_closing = lambda: received_data.closed
|
||||
transport.write = received_data.write
|
||||
server_protocol.connection_made(transport)
|
||||
blob_request = BlobRequest.make_request_for_blob_hash(blob_hash).serialize()
|
||||
|
|
Loading…
Reference in a new issue