1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 19:38:09 +00:00
trezor-firmware/core/tests/test_storage.py
obrusvit e073e619c9 chore(tests): re-run black and isort on core/tests
isort set to skip the first necessary "from common import *" line. A
better solution would be to get rid of the need of this import in the
future.

[no changelog]
2024-02-22 12:10:12 +01:00

22 lines
555 B
Python

from common import * # isort:skip
from storage import device
from trezor import config
class TestConfig(unittest.TestCase):
def test_counter(self):
config.init()
config.wipe()
for i in range(150):
self.assertEqual(device.next_u2f_counter(), i)
device.set_u2f_counter(350)
for i in range(351, 500):
self.assertEqual(device.next_u2f_counter(), i)
device.set_u2f_counter(0)
self.assertEqual(device.next_u2f_counter(), 1)
if __name__ == "__main__":
unittest.main()