From de8ca9391649a63a79798ee1add49f2e25fc3c8a Mon Sep 17 00:00:00 2001 From: "rmlibre@riseup.net" Date: Mon, 16 Dec 2019 20:16:29 -0500 Subject: [PATCH] add to test cases --- tests/test_tiny_gnupg.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/test_tiny_gnupg.py b/tests/test_tiny_gnupg.py index 4215170..bee3e89 100644 --- a/tests/test_tiny_gnupg.py +++ b/tests/test_tiny_gnupg.py @@ -102,6 +102,8 @@ def test_command(gpg): def test_cipher(gpg): + test_email = "support@keys.openpgp.org" + run(gpg.network_import(test_email)) message = "\n twenty\ntwo\narmed\ndogs\nrush\nthe\nkibble \n\n" for trust_level in range(1, 6): for fingerprint in gpg.list_keys(): @@ -126,6 +128,15 @@ def test_cipher(gpg): uid=gpg.fingerprint, sign=False, ) + nonstandard_encrypted_message_0 = gpg.encrypt( + message=message, + uid=test_email, + ) + nonstandard_encrypted_message_1 = gpg.encrypt( + message=message, + uid=test_email, + sign=False + ) assert gpg.decrypt(encrypted_message_0) == message assert gpg.decrypt(encrypted_message_1) == message assert gpg.decrypt(encrypted_message_2) == message @@ -139,6 +150,7 @@ def test_cipher(gpg): gpg.verify(signed_message_1) gpg.verify(signed_message_2) gpg.verify(signed_message_3) + gpg.delete(test_email) def test_file_io(gpg): @@ -260,7 +272,8 @@ def test_revoke(gpg): except: failed = True finally: - assert failed # server removes the key after revocation. + assert failed # server removes the key after revocation? + # Also, GnuPG bug #T4393 def test_delete(gpg): @@ -270,7 +283,7 @@ def test_delete(gpg): for key_email in gpg.list_keys().values(): if key_email == email: amount_of_test_keys += 1 - gpg.delete(email) + gpg.delete(gpg.fingerprint) amount_of_test_keys_after_delete = 0 for key_email in gpg.list_keys().values(): if key_email == email: