From 1b9773f2cf89b8af65af8d2678858f074e42ed66 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 b3f2484e..0065b318 100644 --- a/src/tests/test_crypto.py +++ b/src/tests/test_crypto.py @@ -66,6 +66,14 @@ class TestCrypto(RIPEMD160TestCase, unittest.TestCase): class TestHighlevelcrypto(unittest.TestCase): """Test highlevelcrypto public functions""" + 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_signatures(self): """Verify sample signatures and newly generated ones""" pubkey_hex = hexlify(sample_pubsigningkey)