forked from LBRYCommunity/lbry-sdk
integration test for announcing both on publish and download
This commit is contained in:
parent
43111f0497
commit
2247b354b3
1 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,24 @@ class FileCommands(CommandTestCase):
|
||||||
await self.daemon.jsonrpc_get('lbry://foo')
|
await self.daemon.jsonrpc_get('lbry://foo')
|
||||||
self.assertEqual(len(self.daemon.jsonrpc_file_list()), 1)
|
self.assertEqual(len(self.daemon.jsonrpc_file_list()), 1)
|
||||||
|
|
||||||
|
async def test_announces(self):
|
||||||
|
# announces on publish
|
||||||
|
self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), [])
|
||||||
|
await self.stream_create('foo', '0.01')
|
||||||
|
stream = self.daemon.jsonrpc_file_list()[0]
|
||||||
|
self.assertSetEqual(
|
||||||
|
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))
|
||||||
|
# announces on download
|
||||||
|
self.assertEqual(await self.daemon.storage.get_blobs_to_announce(), [])
|
||||||
|
stream = await self.daemon.jsonrpc_get('foo')
|
||||||
|
self.assertSetEqual(
|
||||||
|
set(await self.daemon.storage.get_blobs_to_announce()),
|
||||||
|
{stream.sd_hash, stream.descriptor.blobs[0].blob_hash}
|
||||||
|
)
|
||||||
|
|
||||||
async def test_file_list_fields(self):
|
async def test_file_list_fields(self):
|
||||||
await self.stream_create('foo', '0.01')
|
await self.stream_create('foo', '0.01')
|
||||||
file_list = self.sout(self.daemon.jsonrpc_file_list())
|
file_list = self.sout(self.daemon.jsonrpc_file_list())
|
||||||
|
|
Loading…
Add table
Reference in a new issue