MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_dynamic_option_python_plugin

Function test_dynamic_option_python_plugin

tests/test_plugin.py:4606–4626  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

4604
4605
4606def test_dynamic_option_python_plugin(node_factory):
4607 plugin = os.path.join(os.getcwd(), "tests/plugins/dynamic_option.py")
4608 ln = node_factory.get_node(options={"plugin": plugin})
4609 result = ln.rpc.listconfigs("test-dynamic-config")
4610
4611 assert result["configs"]["test-dynamic-config"]["value_str"] == "initial"
4612
4613 assert ln.rpc.dynamic_option_report() == {'test-dynamic-config': 'initial'}
4614 result = ln.rpc.setconfig("test-dynamic-config", "changed")
4615 assert result["config"]["value_str"] == "changed"
4616 assert ln.rpc.dynamic_option_report() == {'test-dynamic-config': 'changed'}
4617
4618 ln.daemon.wait_for_log(
4619 'dynamic_option.py:.*Setting config test-dynamic-config to changed'
4620 )
4621
4622 with pytest.raises(RpcError, match="I don't like bad values!"):
4623 ln.rpc.setconfig("test-dynamic-config", "bad value")
4624
4625 # Does not alter value!
4626 assert ln.rpc.dynamic_option_report() == {'test-dynamic-config': 'changed'}
4627
4628
4629def test_renepay_not_important(node_factory):

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
listconfigsMethod · 0.80
wait_for_logMethod · 0.80
get_nodeMethod · 0.45

Tested by

no test coverage detected