MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_websocket_rune_readonly

Function test_websocket_rune_readonly

tests/test_clnrest.py:362–375  ·  view source on GitHub ↗

Test websocket with default values for options.

(node_factory)

Source from the content-addressed store, hash-verified

360
361
362def test_websocket_rune_readonly(node_factory):
363 """Test websocket with default values for options."""
364 # start a node with clnrest
365 l1, base_url, ca_cert = start_node_with_clnrest(node_factory)
366
367 # http session
368 http_session = http_session_with_retry()
369 http_session.verify = ca_cert.as_posix()
370
371 # readonly rune provided => websocket connection and notifications received
372 rune_readonly = l1.rpc.createrune(restrictions="readonly")['rune']
373 http_session.headers.update({"rune": rune_readonly})
374 notifications = notifications_received_via_websocket(l1, base_url, http_session)
375 assert len([n for n in notifications if not n.get('invoice_creation') is None]) == 1
376
377
378def test_websocket_rune_listnotifications(node_factory):

Callers

nothing calls this directly

Calls 5

start_node_with_clnrestFunction · 0.85
http_session_with_retryFunction · 0.85
updateMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected