2019-09-17 07:19:57 +02:00
|
|
|
from lbry.testcase import CommandTestCase
|
|
|
|
|
|
|
|
|
|
|
|
class AddressManagement(CommandTestCase):
|
|
|
|
|
|
|
|
async def test_address_list(self):
|
2019-09-20 15:25:50 +02:00
|
|
|
addresses = await self.out(self.daemon.jsonrpc_address_list())
|
2019-10-26 05:34:44 +02:00
|
|
|
self.assertItemCount(addresses, 27)
|
2019-09-17 07:19:57 +02:00
|
|
|
|
2019-10-26 05:34:44 +02:00
|
|
|
single = await self.out(self.daemon.jsonrpc_address_list(addresses['items'][11]['address']))
|
|
|
|
self.assertItemCount(single, 1)
|
|
|
|
self.assertEqual(single['items'][0], addresses['items'][11])
|
2019-11-22 21:15:54 +01:00
|
|
|
|
2019-11-22 21:27:03 +01:00
|
|
|
class SettingsManagement(CommandTestCase):
|
|
|
|
|
2019-11-22 21:15:54 +01:00
|
|
|
async def test_settings(self):
|
2019-11-23 03:41:27 +01:00
|
|
|
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('127.0.0.1', 50001))
|
2019-11-22 21:15:54 +01:00
|
|
|
|
2019-11-23 03:41:27 +01:00
|
|
|
setting = self.daemon.jsonrpc_settings_set('lbryum_servers', ['server:50001'])
|
2019-11-22 22:20:24 +01:00
|
|
|
self.assertEqual(setting['lbryum_servers'][0], ('server', 50001))
|
2019-11-23 03:41:27 +01:00
|
|
|
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('server', 50001))
|
2019-11-22 22:20:24 +01:00
|
|
|
|
2019-11-23 03:41:27 +01:00
|
|
|
setting = self.daemon.jsonrpc_settings_clear('lbryum_servers')
|
|
|
|
self.assertEqual(setting['lbryum_servers'][0], ('spv1.lbry.com', 50001))
|
|
|
|
self.assertEqual(self.daemon.jsonrpc_settings_get()['lbryum_servers'][0], ('spv1.lbry.com', 50001))
|