1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00
trezor-firmware/tests/test_trezor.msg.py

20 lines
507 B
Python

from common import *
from trezor.crypto import random
from trezor import msg
class TestMsg(unittest.TestCase):
def test_set_get_interfaces(self):
ifaces = msg.get_interfaces()
self.assertEqual(ifaces, ())
for n in range(1, 9):
ifaces = tuple((random.uniform(0x10000) for _ in range(n)))
msg.set_interfaces(ifaces)
ifaces2 = msg.get_interfaces()
self.assertEqual(ifaces, ifaces2)
if __name__ == '__main__':
unittest.main()