tCover protocol/handle_query in test case. - obelisk - Electrum server using libbitcoin as its backend
HTML git clone https://git.parazyd.org/obelisk
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit fafe8ca534194414392c99d80d54ac1dd687861f
DIR parent 810a5f87f822eefb97d1e182909dfb0ba301decd
HTML Author: parazyd <parazyd@dyne.org>
Date: Mon, 19 Apr 2021 19:49:58 +0200
Cover protocol/handle_query in test case.
Diffstat:
M tests/test_electrum_protocol.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)
---
DIR diff --git a/tests/test_electrum_protocol.py b/tests/test_electrum_protocol.py
t@@ -399,6 +399,21 @@ async def test_send_reply(protocol, writer, method):
assert_equal(writer.mock, expect)
+async def test_handle_query(protocol, writer, method):
+ query = {"jsonrpc": "2.0", "method": method, "id": 42, "params": []}
+ await protocol.handle_query(writer, query)
+
+ method = "server.donation_address"
+ query = {"jsonrpc": "2.0", "method": method, "id": 42, "params": []}
+ await protocol.handle_query(writer, query)
+
+ query = {"jsonrpc": "2.0", "method": method, "params": []}
+ await protocol.handle_query(writer, query)
+
+ query = {"jsonrpc": "2.0", "id": 42, "params": []}
+ await protocol.handle_query(writer, query)
+
+
class MockTransport:
def __init__(self):
t@@ -450,6 +465,7 @@ orchestration = {
"server.peers_subscribe": test_peers_subscribe,
"_send_notification": test_send_notification,
"_send_reply": test_send_reply,
+ "_handle_query": test_handle_query,
}