mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-09 16:14:19 +01:00
pytest: Test LightningRpc and plugin command notification support
This commit is contained in:
19
tests/plugins/countdown.py
Executable file
19
tests/plugins/countdown.py
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pyln.client import Plugin
|
||||
import time
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.method("countdown")
|
||||
def countdown(count, plugin, request):
|
||||
count = int(count)
|
||||
for i in range(count):
|
||||
time.sleep(0.1)
|
||||
request.notify("{}/{}".format(i, count), "INFO")
|
||||
|
||||
return "Done"
|
||||
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user