fix test_announces

This commit is contained in:
Victor Shyba 2022-02-08 23:14:18 -03:00 committed by Victor Shyba
parent ec0d9f06c5
commit 89ed04f8a7

View file

@ -107,18 +107,12 @@ class FileCommands(CommandTestCase):
self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), []) self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), [])
await self.stream_create('foo', '0.01') await self.stream_create('foo', '0.01')
stream = (await self.daemon.jsonrpc_file_list())["items"][0] stream = (await self.daemon.jsonrpc_file_list())["items"][0]
self.assertSetEqual( self.assertSetEqual(set(await self.daemon.storage.get_blobs_to_announce()), {stream.sd_hash})
set(await self.daemon.storage.get_blobs_to_announce()),
{stream.sd_hash, stream.descriptor.blobs[0].blob_hash}
)
self.assertTrue(await self.daemon.jsonrpc_file_delete(delete_all=True)) self.assertTrue(await self.daemon.jsonrpc_file_delete(delete_all=True))
# announces on download # announces on download
self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), []) self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), [])
stream = await self.daemon.jsonrpc_get('foo') stream = await self.daemon.jsonrpc_get('foo')
self.assertSetEqual( self.assertSetEqual(set(await self.daemon.storage.get_blobs_to_announce()), {stream.sd_hash})
set(await self.daemon.storage.get_blobs_to_announce()),
{stream.sd_hash, stream.descriptor.blobs[0].blob_hash}
)
async def _purge_file(self, claim_name, full_path): async def _purge_file(self, claim_name, full_path):
self.assertTrue( self.assertTrue(