-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #237: ensure local variable is initialized even when an exception…
… occurs.
- Loading branch information
Showing
3 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
""" | ||
A test harness for gnupg.py. | ||
Copyright (C) 2008-2023 Vinay Sajip. All rights reserved. | ||
Copyright (C) 2008-2024 Vinay Sajip. All rights reserved. | ||
""" | ||
import argparse | ||
import json | ||
|
@@ -1554,16 +1554,17 @@ def test_multiple_signatures_one_invalid(self): | |
|
||
@skipIf('CI' not in os.environ, "Don't test locally") | ||
def test_auto_key_locating(self): | ||
gpg = self.gpg | ||
|
||
# Let's hope ProtonMail doesn't change their key anytime soon | ||
expected_fingerprint = "90E619A84E85330A692F6D81A655882018DBFA9D" | ||
expected_type = "rsa2048" | ||
expected_fingerprint = '90E619A84E85330A692F6D81A655882018DBFA9D' | ||
# expected_type = 'rsa2048' | ||
|
||
actual = self.gpg.auto_locate_key("[email protected]") | ||
actual = self.gpg.auto_locate_key('[email protected]') | ||
|
||
self.assertEqual(actual.fingerprint, expected_fingerprint) | ||
|
||
def test_passphrase_encoding(self): | ||
self.assertRaises(UnicodeEncodeError, self.gpg.decrypt, 'foo', passphrase=u'I’ll') | ||
|
||
|
||
TEST_GROUPS = { | ||
'sign': | ||
|
@@ -1586,7 +1587,7 @@ def test_auto_key_locating(self): | |
'basic': | ||
set(['test_environment', 'test_list_keys_initial', 'test_nogpg', 'test_make_args', 'test_quote_with_shell']), | ||
'test': | ||
set(['test_auto_key_locating']), | ||
set(['test_passphrase_encoding']), | ||
} | ||
|
||
|
||
|