(node_factory)
| 4604 | |
| 4605 | |
| 4606 | def 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 | |
| 4629 | def test_renepay_not_important(node_factory): |
nothing calls this directly
no test coverage detected