# Functional tests `application_client/` is the Python client: APDU encoding, transaction and covenant builders, response unpackers, and an independent reimplementation of the Handshake sighash used to cross-check the device's signatures. `standalone/` holds the tests, run against the app started from the device dashboard. There is no swap test directory: swap is not implemented (see `src/swap.rs`), and `handler_sign_review` refuses outright when swap parameters are present rather than auto-approving. ## Running ```sh ../scripts/test # stax ../scripts/test nanosp # or flex / nanox / apex_p ``` Speculos does not run natively on macOS, so `scripts/test` runs it and ragger in a container built from `Dockerfile` here, on top of Ledger's dev-tools image. That image ships speculos but not ragger, and its system Python is PEP-668 managed, so ragger is installed into the same venv speculos lives in. All five devices pass. To run pytest directly instead (on Linux, with ragger installed): ```sh pip install -r standalone/requirements.txt pytest standalone --tb=short -v --device stax ``` ## Snapshots UI tests compare against golden PNGs under `standalone/snapshots///`. Regenerate with `../scripts/test --golden_run`. Read the diff before committing one: those images are the record of what the user is shown before they approve a signature. `standalone/test_sign_tx_policy.py` deliberately needs none of them: every case there is refused before the device draws anything. `standalone/review_nav.py` explains why the approval path drives the navigator directly instead of using `scenario_navigator.review_approve()`.