From a882f2e8c5091916a44a8173b00fde579700717e Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 10 Apr 2019 09:36:02 -0400 Subject: [PATCH] merge conflicts --- lbrynet/extras/daemon/Daemon.py | 2 +- tests/integration/test_file_commands.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index de2a49d74..c45e5d62a 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -473,7 +473,7 @@ class Daemon(metaclass=JSONRPCServerType): name, claim_id = name_and_claim_id.split("/") uri = f"lbry://{name}#{claim_id}" stream = await self.jsonrpc_get(uri) - return web.HTTPFound(f"http://localhost:5279/stream/{stream['sd_hash']}") + return web.HTTPFound(f"http://localhost:5279/stream/{stream.sd_hash}") async def handle_stream_range_request(self, request: web.Request): sd_hash = request.path.split("/stream/")[1] diff --git a/tests/integration/test_file_commands.py b/tests/integration/test_file_commands.py index 5fbc9eaff..3df876dcc 100644 --- a/tests/integration/test_file_commands.py +++ b/tests/integration/test_file_commands.py @@ -60,7 +60,7 @@ class FileCommands(CommandTestCase): await asyncio.wait_for(self.wait_files_to_complete(), timeout=5) # if this hangs, file didnt get set completed # check that internal state got through up to the file list API stream = self.daemon.stream_manager.get_stream_by_stream_hash(file_info['stream_hash']) - file_info = self.daemon.jsonrpc_file_list()[0] + file_info = self.sout(self.daemon.jsonrpc_file_list()[0]) self.assertEqual(stream.file_name, file_info['file_name']) # checks if what the API shows is what he have at the very internal level. self.assertEqual(stream.full_path, file_info['download_path']) @@ -77,13 +77,14 @@ class FileCommands(CommandTestCase): blob.blob_hash for blob in blobs[1:-1] ] await self.server.blob_manager.delete_blobs(all_except_sd_and_head) - self.assertFalse(os.path.isfile(os.path.join(self.daemon.conf.download_dir, file_info['file_name']))) + path = os.path.join(self.daemon.conf.download_dir, file_info['file_name']) + self.assertFalse(os.path.isfile(path)) resp = await self.out(self.daemon.jsonrpc_get('lbry://foo', timeout=2)) self.assertNotIn('error', resp) - self.assertTrue(os.path.isfile(os.path.join(self.daemon.conf.download_dir, file_info['file_name']))) + self.assertTrue(os.path.isfile(path)) self.daemon.stream_manager.stop() await asyncio.sleep(0, loop=self.loop) - self.assertFalse(os.path.isfile(os.path.join(self.daemon.conf.download_dir, file_info['file_name']))) + self.assertFalse(os.path.isfile(path)) async def test_incomplete_downloads_retry(self): tx = await self.stream_create('foo', '0.01', data=b'deadbeef' * 1000000) @@ -174,9 +175,8 @@ class FileCommands(CommandTestCase): ) await self.daemon.jsonrpc_file_delete(claim_name='icanpay') await self.assertBalance(self.account, '9.925679') - response = await self.out(self.daemon.jsonrpc_get('lbry://icanpay')) - self.assertNotIn('error', response) - await self.on_transaction_dict(response['content_fee']) + response = await self.daemon.jsonrpc_get('lbry://icanpay') + await self.ledger.wait(response.content_fee) await self.assertBalance(self.account, '8.925555') self.assertEqual(len(self.daemon.jsonrpc_file_list()), 1)