1
0

Merge pull request #9729 from spesmilo/recursive_config

recursive config file
This commit is contained in:
ThomasV
2025-04-11 20:02:25 +02:00
committed by GitHub
6 changed files with 59 additions and 27 deletions

View File

@@ -89,8 +89,8 @@ class TestLightningSwapserver(TestLightning):
},
'bob': {
'lightning_listen': 'localhost:9735',
'enable_plugin_swapserver': 'true',
'swapserver_port': '5455',
'plugins.swapserver.enabled': 'true',
'plugins.swapserver.port': '5455',
'nostr_relays': "''",
}
}
@@ -115,10 +115,10 @@ class TestLightningWatchtower(TestLightning):
'watchtower_url': 'http://wtuser:wtpassword@127.0.0.1:12345',
},
'carol': {
'enable_plugin_watchtower': 'true',
'watchtower_server_user': 'wtuser',
'watchtower_server_password': 'wtpassword',
'watchtower_server_port': '12345',
'plugins.watchtower.enabled': 'true',
'plugins.watchtower.server_user': 'wtuser',
'plugins.watchtower.server_password': 'wtpassword',
'plugins.watchtower.server_port': '12345',
}
}

View File

@@ -203,6 +203,17 @@ class Test_SimpleConfig(ElectrumTestCase):
with self.assertRaises(KeyError):
config.cv.from_key("server333")
def test_recursive_config(self):
config = SimpleConfig(self.options)
n = len(config.user_config)
config.set_key('x.y.z', 1)
self.assertEqual(len(config.user_config), n + 1)
config.set_key('x.y.w', 1)
self.assertEqual(len(config.user_config), n + 1)
config.set_key('x.y.z', None)
self.assertEqual(len(config.user_config), n + 1)
config.set_key('x.y.w', None)
self.assertEqual(len(config.user_config), n)
class TestUserConfig(ElectrumTestCase):