From 903ed9f3dcab018703464d8e174be3144d66b1af Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 7 Nov 2021 04:21:58 -0300 Subject: [PATCH] fix tests by checking there are actual blobs being deleted --- .../integration/datanetwork/test_file_commands.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/integration/datanetwork/test_file_commands.py b/tests/integration/datanetwork/test_file_commands.py index 12b999935..0706b8e77 100644 --- a/tests/integration/datanetwork/test_file_commands.py +++ b/tests/integration/datanetwork/test_file_commands.py @@ -322,10 +322,11 @@ class FileCommands(CommandTestCase): tx = await self.stream_create('foo', '0.01', data=b'deadbeef' * 1000000) sd_hash = tx['outputs'][0]['value']['source']['sd_hash'] file_info = (await self.file_list())[0] - await self.daemon.jsonrpc_file_delete(claim_name='foo') - blobs = await self.server_storage.get_blobs_for_stream( - await self.server_storage.get_stream_hash_for_sd_hash(sd_hash) + blobs = await self.daemon.storage.get_blobs_for_stream( + await self.daemon.storage.get_stream_hash_for_sd_hash(sd_hash) ) + await self.daemon.jsonrpc_file_delete(claim_name='foo') + self.assertEqual(5, len(blobs)) all_except_sd_and_head = [ blob.blob_hash for blob in blobs[1:-1] ] @@ -342,10 +343,11 @@ class FileCommands(CommandTestCase): async def test_incomplete_downloads_retry(self): tx = await self.stream_create('foo', '0.01', data=b'deadbeef' * 1000000) sd_hash = tx['outputs'][0]['value']['source']['sd_hash'] - await self.daemon.jsonrpc_file_delete(claim_name='foo') - blobs = await self.server_storage.get_blobs_for_stream( - await self.server_storage.get_stream_hash_for_sd_hash(sd_hash) + blobs = await self.daemon.storage.get_blobs_for_stream( + await self.daemon.storage.get_stream_hash_for_sd_hash(sd_hash) ) + self.assertEqual(5, len(blobs)) + await self.daemon.jsonrpc_file_delete(claim_name='foo') all_except_sd_and_head = [ blob.blob_hash for blob in blobs[1:-1] ]