You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/tests/test_trezor.msg.py

20 lines
507 B

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()