From bbede1d449b65afcd53b99f8a5684743316c1d8c Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 9 Dec 2021 18:44:57 +0200 Subject: [PATCH] A dummy test for randomBytes --- src/tests/test_crypto.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/test_crypto.py b/src/tests/test_crypto.py index 3563098d..024fa23f 100644 --- a/src/tests/test_crypto.py +++ b/src/tests/test_crypto.py @@ -74,6 +74,14 @@ class TestHighlevelcrypto(unittest.TestCase): self.assertEqual( highlevelcrypto.double_sha512(b'hello'), sample_double_sha512) + def test_randomBytes(self): + """Dummy checks for random bytes""" + for n in (8, 32, 64): + data = highlevelcrypto.randomBytes(n) + self.assertEqual(len(data), n) + self.assertNotEqual(len(set(data)), 1) + self.assertNotEqual(data, highlevelcrypto.randomBytes(n)) + def test_verify(self): """Verify sample signatures and newly generated ones""" pubkey_hex = hexlify(sample_pubsigningkey)