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

Function test_websocket_rune_no_listnotifications

tests/test_clnrest.py:394–407  ·  view source on GitHub ↗

Test websocket with default values for options.

(node_factory)

Source from the content-addressed store, hash-verified

392
393
394def test_websocket_rune_no_listnotifications(node_factory):
395 """Test websocket with default values for options."""
396 # start a node with clnrest
397 l1, base_url, ca_cert = start_node_with_clnrest(node_factory)
398
399 # http session
400 http_session = http_session_with_retry()
401 http_session.verify = ca_cert.as_posix()
402
403 # with a rune which doesn't authorized listclnrest-notifications method => no websocket connection and no notification received
404 rune_no_clnrest_notifications = l1.rpc.createrune(restrictions=[["method/listclnrest-notifications"]])['rune']
405 http_session.headers.update({"rune": rune_no_clnrest_notifications})
406 notifications = notifications_received_via_websocket(l1, base_url, http_session, expect_error="Not permitted: method is equal to listclnrest-notifications")
407 assert len([n for n in notifications if n.find('invoice_creation') > 0]) == 0
408
409
410def test_numeric_msat_notification(node_factory):

Callers

nothing calls this directly

Calls 4

start_node_with_clnrestFunction · 0.85
http_session_with_retryFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected