From 7a160f73353749b6ecae3f62decd06a2acef5ac0 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 4 Apr 2019 22:02:33 -0400 Subject: [PATCH] fix tests --- lbrynet/stream/stream_manager.py | 1 + tests/integration/test_file_commands.py | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lbrynet/stream/stream_manager.py b/lbrynet/stream/stream_manager.py index 3019d897f..d339aa9a5 100644 --- a/lbrynet/stream/stream_manager.py +++ b/lbrynet/stream/stream_manager.py @@ -394,6 +394,7 @@ class StreamManager: error = err if stream and stream.descriptor: await self.storage.delete_stream(stream.descriptor) + await self.blob_manager.delete_blob(stream.sd_hash) finally: if self.analytics_manager and (error or (stream and (stream.downloader.time_to_descriptor or stream.downloader.time_to_first_bytes))): diff --git a/tests/integration/test_file_commands.py b/tests/integration/test_file_commands.py index 8a6265eaf..7d4e41307 100644 --- a/tests/integration/test_file_commands.py +++ b/tests/integration/test_file_commands.py @@ -59,14 +59,11 @@ class FileCommands(CommandTestCase): await self.daemon.stream_manager.start() 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 - downloader = self.daemon.stream_manager.get_stream_by_stream_hash(file_info['stream_hash']).downloader - file_info = self.sout(self.daemon.jsonrpc_file_list())[0] - self.assertEqual(downloader.output_file_name, file_info['file_name']) + stream = self.daemon.stream_manager.get_stream_by_stream_hash(file_info['stream_hash']) + file_info = 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(downloader.output_path, file_info['download_path']) - # if you got here refactoring just change above, but ensure what gets set internally gets reflected externally! - self.assertTrue(downloader.output_path.endswith(downloader.output_file_name)) - # this used to be inconsistent, if it becomes again it would create weird bugs, so worth checking + self.assertEqual(stream.full_path, file_info['download_path']) async def test_incomplete_downloads_erases_output_file_on_stop(self): tx = await self.stream_create('foo', '0.01')