From 0fc5cd59278069c9bc8a74c6380c474428e88c2b Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Fri, 10 Dec 2021 18:44:26 +0200 Subject: [PATCH] Started a dummy test for random keys in pyelliptic.ECC() --- src/pyelliptic/tests/test_ecc.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/pyelliptic/tests/test_ecc.py diff --git a/src/pyelliptic/tests/test_ecc.py b/src/pyelliptic/tests/test_ecc.py new file mode 100644 index 00000000..4a6a5aef --- /dev/null +++ b/src/pyelliptic/tests/test_ecc.py @@ -0,0 +1,19 @@ +"""Tests for ECC object""" + +import unittest + +try: + from pyelliptic.ecc import ECC +except ImportError: + from pybitmessage.pyelliptic import ECC + + +class TestECC(unittest.TestCase): + """The test case for ECC""" + + def test_random_keys(self): + """A dummy test for random keys in ECC object""" + eccobj = ECC(curve='secp256k1') + self.assertEqual(len(eccobj.privkey), 32) + pubkey = eccobj.get_pubkey() + self.assertEqual(pubkey[:4], b'\x02\xca\x00\x20')