Add TestKeypairs TestCase with test_ecies_keypair_generation

pull/79/head
tuxxy 2017-10-11 13:51:58 -06:00
parent 8e29c079d0
commit 263b21a84e
No known key found for this signature in database
GPG Key ID: 7BB971A0E89144D9
3 changed files with 19 additions and 0 deletions

View File

View File

@ -0,0 +1,19 @@
import unittest
from nkms.keystore import keypairs
class TestKeypairs(unittest.TestCase):
def setUp(self):
self.ecies_keypair = keypairs.EncryptingKeypair()
self.ecdsa_keypair = keypairs.SigningKeypair()
def test_ecies_keypair_generation(self):
self.ecies_keypair.gen_privkey()
self.assertTrue(self.ecies_keypair.privkey != None)
self.assertEqual(bytes, type(self.ecies_keypair.privkey))
self.assertEqual(32, len(self.ecies_keypair.privkey))
self.assertTrue(self.ecies_keypair.pubkey != None)
self.assertEqual(bytes, type(self.ecies_keypair.pubkey))
self.assertEqual(33, len(self.ecies_keypair.pubkey))

View File