From 6c9f61a27667843f245630c67f332cad7630e876 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 21 Sep 2015 23:40:19 -0400 Subject: Better test for keypair object class. --- unit_tests.py | 4 ++-- 1 file 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( -- cgit v1.2.3