mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
pytest: add test for a plugin which falls over outside a command.
This actually passes fine, but it's an interesting case to test. Fixed-by: Darosior <darosior@protonmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1218,3 +1218,18 @@ def test_replacement_payload(node_factory):
|
||||
l1.rpc.pay(inv)
|
||||
|
||||
assert l2.daemon.wait_for_log("Attept to pay.*with wrong secret")
|
||||
|
||||
|
||||
def test_plugin_fail(node_factory):
|
||||
"""Test that a plugin which fails (not during a command)"""
|
||||
plugin = os.path.join(os.path.dirname(__file__), 'plugins/fail_by_itself.py')
|
||||
l1 = node_factory.get_node(options={"plugin": plugin})
|
||||
|
||||
time.sleep(2)
|
||||
# It should clean up!
|
||||
assert 'failcmd' not in [h['command'] for h in l1.rpc.help()['help']]
|
||||
|
||||
l1.rpc.plugin_start(plugin)
|
||||
time.sleep(2)
|
||||
# It should clean up!
|
||||
assert 'failcmd' not in [h['command'] for h in l1.rpc.help()['help']]
|
||||
|
||||
Reference in New Issue
Block a user