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

Function test_websocket_wrong_rune

tests/test_clnrest.py:330–345  ·  view source on GitHub ↗

Test websocket with default values for options.

(node_factory)

Source from the content-addressed store, hash-verified

328
329
330def test_websocket_wrong_rune(node_factory):
331 """Test websocket with default values for options."""
332 # start a node with clnrest
333 l1, base_url, ca_cert = start_node_with_clnrest(node_factory)
334
335 # http session
336 http_session = http_session_with_retry()
337 http_session.verify = ca_cert.as_posix()
338
339 # wrong rune provided => no websocket connection and no notification received
340 http_session.headers.update({"rune": "jMHrjVJb5l9-mjEd7zwux7Ookra1fgZ8wa9D8QbVT-w9MA=="})
341
342 notifications = notifications_received_via_websocket(l1, base_url, http_session, expect_error="Not derived from master")
343 l1.daemon.logsearch_start = 0
344 assert l1.daemon.wait_for_log(r"Error code 1501: Not authorized: Not derived from master")
345 assert len(notifications) == 0
346
347
348def test_websocket_unrestricted_rune(node_factory):

Callers

nothing calls this directly

Calls 5

start_node_with_clnrestFunction · 0.85
http_session_with_retryFunction · 0.85
updateMethod · 0.80
wait_for_logMethod · 0.80

Tested by

no test coverage detected