Files
trezor-firmware/core/tests
Roman Zeyde 456ea7d5d6 feat(core+python): support device unlocking during THP handshake
Add a flag to the first THP handshake message, so the device can:

- fail the handshake if the device is locked (current behavior)
- prompt the user to enter the PIN (similar to other non-pairing flows)

NOTE: This is a backward-incompatible change, so Suite THP implementation MUST be adapted as well.

Co-authored-by: M1nd3r <petrsedlacek.km@seznam.cz>
2025-10-06 11:20:33 +02:00
..
2024-12-06 16:14:54 +01:00

Unit tests

Unit tests test some smaller individual parts of code (mainly functions and classes) and are run by micropython directly.

How to run them

Run all tests:

make test

Run a specific test file:

make test TESTOPTS=test_apps.bitcoin.signtx.py

WARNING: unittests cannot run with frozen emulator, use make build_unix to create non-frozen emulator.

Usage

Please use the unittest.TestCase class:

from common import *

class TestSomething(unittest.TestCase):

    test_something(self):
        self.assertTrue(True)

Usage of assert is discouraged because it is not evaluated in production code (when PYOPT=1). Use self.assertXY instead, see unittest.py.