From 9f83cce574d0bc39f113c557c3a6a48fb9513485 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 29 Apr 2019 00:37:01 -0300 Subject: [PATCH] test confirmations and timestamp on file list, being updated on resolve --- tests/integration/test_file_commands.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration/test_file_commands.py b/tests/integration/test_file_commands.py index 11164d860..5ccde6068 100644 --- a/tests/integration/test_file_commands.py +++ b/tests/integration/test_file_commands.py @@ -28,6 +28,23 @@ class FileCommands(CommandTestCase): await self.daemon.jsonrpc_get('lbry://foo') self.assertEqual(len(self.daemon.jsonrpc_file_list()), 1) + async def test_file_list_fields(self): + await self.stream_create('foo', '0.01') + file_list = self.sout(self.daemon.jsonrpc_file_list()) + self.assertEqual( + file_list[0]['timestamp'], + None + ) + self.assertEqual(file_list[0]['confirmations'], -1) + await self.daemon.jsonrpc_resolve('foo') + file_list = self.sout(self.daemon.jsonrpc_file_list()) + self.assertEqual( + file_list[0]['timestamp'], + self.ledger.headers[file_list[0]['height']]['timestamp'] + ) + self.assertEqual(file_list[0]['confirmations'], 1) + + async def test_file_list_updated_metadata_on_resolve(self): await self.stream_create('foo', '0.01') claim = await self.daemon.resolve('lbry://foo')