From 823342f5484db142ad8e6deecee3a09c03684c85 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 4 Aug 2017 09:33:11 -0700 Subject: tests/crypto: Add more tests for list_keys This adds two new tests for the list_keys function that assert that the private flag is honored. --- tests/crypto_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index e0e52cee..d0877bea 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -236,6 +236,16 @@ class TestListKeys(unittest.TestCase): values = crypto.list_keys(hint="ambig") self.assertEqual(len(list(values)), 2) + def test_list_keys_pub(self): + values = list(crypto.list_keys(hint="ambigu"))[0] + self.assertEqual(values.uids[0].email, u'amigbu@example.com') + self.assertFalse(values.secret) + + def test_list_keys_private(self): + values = list(crypto.list_keys(hint="ambigu", private=True))[0] + self.assertEqual(values.uids[0].email, u'amigbu@example.com') + self.assertTrue(values.secret) + class TestGetKey(unittest.TestCase): -- cgit v1.2.3