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

Function test_websocket_rune_readonly

tests/test_clnrest.py:364–377  ·  view source on GitHub ↗

Test websocket with default values for options.

(node_factory)

Source from the content-addressed store, hash-verified

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