fixing tests to work with asyncio daemon

This commit is contained in:
Lex Berezhny 2019-01-07 02:52:53 -05:00
parent 7f838d3a31
commit 4bb8129bb7
25 changed files with 296 additions and 336 deletions
lbrynet/blob/client

View file

@ -65,14 +65,9 @@ class EncryptedFileDownloader(CryptStreamDownloader):
def _close_output(self):
pass
def get_total_bytes(self):
d = self.storage.get_blobs_for_stream(self.stream_hash)
def calculate_size(blobs):
return sum([b.length for b in blobs])
d.addCallback(calculate_size)
return d
async def get_total_bytes(self):
blobs = await self.storage.get_blobs_for_stream(self.stream_hash)
return sum([b.length for b in blobs])
def get_total_bytes_cached(self):
if self._calculated_total_bytes is None or self._calculated_total_bytes == 0: