WebSocket client + CLI harness + pytest suite that exercises each axis of a CKBunker + Coldcard Mk4 policy and asserts the expected outcomes, including the critical negative test that a large PSBT without TOTP is rejected with a specific 'rule #1: need user(s) confirmation' reason. Configuration via .env / YAML / CLI flags, two pre-crafted test PSBTs as fixtures (generation guide in fixtures/README.md), dashboard counter scraper as sanity check, design rationale in docs/.
13 lines
569 B
Python
13 lines
569 B
Python
"""Basic reachability: CKBunker answers HTTP and exposes a WebSocket URL."""
|
|
|
|
from ckbunker_hsm_sign import Client
|
|
|
|
|
|
def test_http_endpoint_reachable(client: Client):
|
|
ws_url, cookies = client.fetch_ws_endpoint()
|
|
assert ws_url.startswith("ws://") or ws_url.startswith("wss://"), ws_url
|
|
# A session cookie is not strictly required by CKBunker, but its absence
|
|
# often means we were silently rate-limited or hit the wrong hostname.
|
|
# Surface it so the operator notices.
|
|
assert cookies is not None # even "" is acceptable; None means parse failure
|