aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-09-21 23:40:19 -0400
committerRob Austein <sra@hactrn.net>2015-09-21 23:40:19 -0400
commit6c9f61a27667843f245630c67f332cad7630e876 (patch)
tree0e3d6ef6ff5bd606c3b80b1a78f3e164589f1295
parent95474a873859bb8a0991ef3973f0340f30025ce2 (diff)
Better test for keypair object class.
-rw-r--r--unit_tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/unit_tests.py b/unit_tests.py
index b82a479..cd47886 100644
--- a/unit_tests.py
+++ b/unit_tests.py
@@ -126,8 +126,8 @@ class TestKeys(unittest.TestCase):
def assertIsKeypair(self, public_handle, private_handle = None):
if isinstance(public_handle, tuple) and private_handle is None:
public_handle, private_handle = public_handle
- self.assertEqual(p11.C_GetAttributeValue(self.session, public_handle, CKA_CLASS)[CKA_CLASS], CKO_PUBLIC_KEY)
- self.assertEqual(p11.C_GetAttributeValue(self.session, private_handle, CKA_CLASS)[CKA_CLASS], CKO_PRIVATE_KEY)
+ self.assertEqual(p11.C_GetAttributeValue(self.session, public_handle, CKA_CLASS), {CKA_CLASS: CKO_PUBLIC_KEY})
+ self.assertEqual(p11.C_GetAttributeValue(self.session, private_handle, CKA_CLASS), {CKA_CLASS: CKO_PRIVATE_KEY})
def test_keygen_token_vs_session(self):
self.assertIsKeypair(