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

Function test_websocket_wrong_rune

tests/test_clnrest.py:328–343  ·  view source on GitHub ↗

Test websocket with default values for options.

(node_factory)

Source from the content-addressed store, hash-verified

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