Started a dummy test for random keys in pyelliptic.ECC()

This commit is contained in:
Dmitri Bogomolov 2021-12-10 18:44:26 +02:00 committed by Lee Miller
parent fe7f8f6c95
commit 0fc5cd5927
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63

View File

@ -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')