Skip to content

Commit 1b9773f

Browse files
g1itchLee Miller
authored andcommitted
A dummy test for randomBytes
1 parent c7a3bfa commit 1b9773f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/tests/test_crypto.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ def _hashdigest(data):
6666
class TestHighlevelcrypto(unittest.TestCase):
6767
"""Test highlevelcrypto public functions"""
6868

69+
def test_randomBytes(self):
70+
"""Dummy checks for random bytes"""
71+
for n in (8, 32, 64):
72+
data = highlevelcrypto.randomBytes(n)
73+
self.assertEqual(len(data), n)
74+
self.assertNotEqual(len(set(data)), 1)
75+
self.assertNotEqual(data, highlevelcrypto.randomBytes(n))
76+
6977
def test_signatures(self):
7078
"""Verify sample signatures and newly generated ones"""
7179
pubkey_hex = hexlify(sample_pubsigningkey)

0 commit comments

Comments
 (0)