mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-25 08:54:20 +01:00
donations: fix the stop method
This commit is contained in:
@@ -139,7 +139,7 @@ def stop_server(port):
|
||||
|
||||
|
||||
@plugin.method('donationserver')
|
||||
def donationserver(request, command="start", port=8088):
|
||||
def donationserver(command="start", port=8088):
|
||||
"""Starts a donationserver with {start/stop/restart} on {port}.
|
||||
|
||||
A Simple HTTP Server is created that can serve a donation webpage and
|
||||
@@ -177,7 +177,7 @@ def donationserver(request, command="start", port=8088):
|
||||
if stop_server(port):
|
||||
return "stopped server on port {}".format(port)
|
||||
else:
|
||||
return "could not stop the server"
|
||||
return "could not stop the server on port {}".format(port)
|
||||
|
||||
if command == "restart":
|
||||
stop_server(port)
|
||||
|
||||
@@ -25,5 +25,5 @@ def test_donation_server(node_factory):
|
||||
port = reserve()
|
||||
l1.rpc.donationserver('start', port)
|
||||
l1.daemon.wait_for_logs('plugin-donations.py: Process server on port')
|
||||
msg = l1.rpc.donationserver("stop")
|
||||
msg = l1.rpc.donationserver("stop", port)
|
||||
assert msg.startswith(f'stopped server on port')
|
||||
|
||||
Reference in New Issue
Block a user