mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
pytest: test rpc_command hook when it handles command to stop itself.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
a30ee2b7cd
commit
d8fc5332c3
@@ -4,7 +4,7 @@ This plugin is used to test the `rpc_command` hook.
|
|||||||
"""
|
"""
|
||||||
from lightning import Plugin
|
from lightning import Plugin
|
||||||
|
|
||||||
plugin = Plugin(dynamic=False)
|
plugin = Plugin()
|
||||||
|
|
||||||
|
|
||||||
@plugin.hook("rpc_command")
|
@plugin.hook("rpc_command")
|
||||||
|
|||||||
@@ -761,6 +761,7 @@ def test_sendpay_notifications(node_factory, bitcoind):
|
|||||||
assert results['sendpay_failure'][0] == err.value.error
|
assert results['sendpay_failure'][0] == err.value.error
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(strict=True)
|
||||||
def test_rpc_command_hook(node_factory):
|
def test_rpc_command_hook(node_factory):
|
||||||
"""Test the `sensitive_command` hook"""
|
"""Test the `sensitive_command` hook"""
|
||||||
plugin = os.path.join(os.getcwd(), "tests/plugins/rpc_command.py")
|
plugin = os.path.join(os.getcwd(), "tests/plugins/rpc_command.py")
|
||||||
@@ -778,3 +779,6 @@ def test_rpc_command_hook(node_factory):
|
|||||||
# The plugin sends a custom response to "listfunds"
|
# The plugin sends a custom response to "listfunds"
|
||||||
funds = l1.rpc.listfunds()
|
funds = l1.rpc.listfunds()
|
||||||
assert funds[0] == "Custom result"
|
assert funds[0] == "Custom result"
|
||||||
|
|
||||||
|
# Test command which removes plugin itself!
|
||||||
|
l1.rpc.plugin_stop('rpc_command.py')
|
||||||
|
|||||||
Reference in New Issue
Block a user