From 4b1492be0d5c21c2bf95a23c33d92f9ae56b5c60 Mon Sep 17 00:00:00 2001 From: jessop Date: Fri, 22 Nov 2019 16:20:24 -0500 Subject: [PATCH] return value and more tests --- lbry/lbry/extras/daemon/Daemon.py | 3 ++- lbry/tests/integration/test_other_commands.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lbry/lbry/extras/daemon/Daemon.py b/lbry/lbry/extras/daemon/Daemon.py index 64f676e0c..ad33ab912 100644 --- a/lbry/lbry/extras/daemon/Daemon.py +++ b/lbry/lbry/extras/daemon/Daemon.py @@ -1022,7 +1022,8 @@ class Daemon(metaclass=JSONRPCServerType): """ with self.conf.update_config() as c: setattr(c, key, NOT_SET) - return + setting = self.conf.settings_dict[key] + return {key: setting} PREFERENCE_DOC = """ Preferences management. diff --git a/lbry/tests/integration/test_other_commands.py b/lbry/tests/integration/test_other_commands.py index 488b45e5a..1c1ca9441 100644 --- a/lbry/tests/integration/test_other_commands.py +++ b/lbry/tests/integration/test_other_commands.py @@ -19,13 +19,16 @@ class SettingsManagement(CommandTestCase): self.assertEqual(settings['lbryum_servers'][0],('127.0.0.1', 50001)) servers = ['server:50001', 'server2:50001'] - self.daemon.jsonrpc_settings_set('lbryum_servers', servers) + setting = self.daemon.jsonrpc_settings_set('lbryum_servers', servers) + self.assertEqual(setting['lbryum_servers'][0], ('server', 50001)) + self.daemon.jsonrpc_settings_set('use_upnp', True) settings2 = self.daemon.jsonrpc_settings_get() self.assertEqual(settings2['lbryum_servers'][0], ('server', 50001)) self.assertEqual(settings2['use_upnp'], True) - self.daemon.jsonrpc_settings_clear('lbryum_servers') + clearing = self.daemon.jsonrpc_settings_clear('lbryum_servers') + self.assertEqual(clearing['lbryum_servers'][0], ('spv1.lbry.com', 50001)) settings3 = self.daemon.jsonrpc_settings_get() self.assertNotEqual(settings3['lbryum_servers'][0], ('spv1.lbry.com', 50002)) self.assertEqual(settings3['lbryum_servers'][0], ('spv1.lbry.com', 50001))