From 263b21a84e6885a1622c6eaa6ea52560385c4a1b Mon Sep 17 00:00:00 2001 From: tuxxy Date: Wed, 11 Oct 2017 13:51:58 -0600 Subject: [PATCH] Add TestKeypairs TestCase with test_ecies_keypair_generation --- nkms/keystore/__init__.py | 0 tests/keystore/test_keypairs.py | 19 +++++++++++++++++++ tests/keystore/test_keystore.py | 0 3 files changed, 19 insertions(+) create mode 100644 nkms/keystore/__init__.py create mode 100644 tests/keystore/test_keypairs.py create mode 100644 tests/keystore/test_keystore.py diff --git a/nkms/keystore/__init__.py b/nkms/keystore/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/keystore/test_keypairs.py b/tests/keystore/test_keypairs.py new file mode 100644 index 000000000..c506beb09 --- /dev/null +++ b/tests/keystore/test_keypairs.py @@ -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)) diff --git a/tests/keystore/test_keystore.py b/tests/keystore/test_keystore.py new file mode 100644 index 000000000..e69de29bb