summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-08-04 09:33:11 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-08-14 09:29:28 -0700
commit823342f5484db142ad8e6deecee3a09c03684c85 (patch)
tree25a1b1aee32d572cac02e0f87d08ca4e1ac3cd7b
parent3b3282c66f09583b29af2729668ceee2a9f703d2 (diff)
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.
-rw-r--r--tests/crypto_test.py10
1 files changed, 10 insertions, 0 deletions
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):