1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 00:28:10 +00:00

tests: make acceptable delta wider in test_trezor.crypto.random

This commit is contained in:
Pavol Rusnak 2018-07-10 20:50:04 +02:00
parent 2f6386e041
commit 2d27ab85dc
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -13,7 +13,7 @@ class TestCryptoRandom(unittest.TestCase):
r = random.uniform(15) r = random.uniform(15)
c[r] += 1 c[r] += 1
for i in range(15): for i in range(15):
self.assertAlmostEqual(c[r], 1000, delta=150) self.assertAlmostEqual(c[r], 1000, delta=200)
def test_bytes_length(self): def test_bytes_length(self):
for l in range(1024 + 1): for l in range(1024 + 1):
@ -34,7 +34,7 @@ class TestCryptoRandom(unittest.TestCase):
for h in hexlify(b): for h in hexlify(b):
c[chr(h)] += 1 c[chr(h)] += 1
for h in '0123456789abcdef': for h in '0123456789abcdef':
self.assertAlmostEqual(c[h], 1000, delta=150) self.assertAlmostEqual(c[h], 1000, delta=200)
def test_shuffle(self): def test_shuffle(self):
for l in range(256 + 1): for l in range(256 + 1):