diff options
author | Rob Austein <sra@hactrn.net> | 2015-09-21 23:40:19 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-09-21 23:40:19 -0400 |
commit | 6c9f61a27667843f245630c67f332cad7630e876 (patch) | |
tree | 0e3d6ef6ff5bd606c3b80b1a78f3e164589f1295 | |
parent | 95474a873859bb8a0991ef3973f0340f30025ce2 (diff) |
Better test for keypair object class.
-rw-r--r-- | unit_tests.py | 4 |
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( |