Skip to content

Commit

Permalink
test_download_torrent: shorter test to find the integration test error
Browse files Browse the repository at this point in the history
  • Loading branch information
belikor committed Sep 13, 2021
1 parent ec518ce commit 8f7aa35
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/integration/datanetwork/test_file_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ async def test_download_torrent(self):
self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
# second call, see its there and move on
self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
self.assertEqual((await self.daemon.jsonrpc_file_list())['items'][0].identifier, btih)
self.assertIn(btih, self.client_session._handles)
tx, new_btih = await self.initialize_torrent(tx)
self.assertNotEqual(btih, new_btih)
# self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))
# self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
# self.assertEqual((await self.daemon.jsonrpc_file_list())['items'][0].identifier, btih)
# self.assertIn(btih, self.client_session._handles)
# tx, new_btih = await self.initialize_torrent(tx)
# self.assertNotEqual(btih, new_btih)
# claim now points to another torrent, update to it
self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))
self.assertEqual((await self.daemon.jsonrpc_file_list())['items'][0].identifier, new_btih)
self.assertIn(new_btih, self.client_session._handles)
self.assertNotIn(btih, self.client_session._handles)
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
await self.daemon.jsonrpc_file_delete(delete_all=True)
self.assertItemCount(await self.daemon.jsonrpc_file_list(), 0)
self.assertNotIn(new_btih, self.client_session._handles)
# self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))
# self.assertEqual((await self.daemon.jsonrpc_file_list())['items'][0].identifier, new_btih)
# self.assertIn(new_btih, self.client_session._handles)
# self.assertNotIn(btih, self.client_session._handles)
# self.assertItemCount(await self.daemon.jsonrpc_file_list(), 1)
# await self.daemon.jsonrpc_file_delete(delete_all=True)
# self.assertItemCount(await self.daemon.jsonrpc_file_list(), 0)
# self.assertNotIn(new_btih, self.client_session._handles)

async def create_streams_in_range(self, *args, **kwargs):
self.stream_claim_ids = []
Expand Down

0 comments on commit 8f7aa35

Please sign in to comment.