fix truth evaluation of import results
for some reason, the count was accessed as if it was a Storage instance, and it's not, it behaves as a dictionnary includes test case that will fail with the original codefix/44-verbose-arg
parent
961bf8da1b
commit
293fa6b2e0
|
|
@ -1048,7 +1048,7 @@ class ImportResult(object):
|
|||
:rtype: bool
|
||||
:returns: True if we have immport some keys, False otherwise.
|
||||
"""
|
||||
if self.counts.not_imported > 0: return False
|
||||
if self.counts['not_imported'] > 0: return False
|
||||
if len(self.fingerprints) == 0: return False
|
||||
return True
|
||||
__bool__ = __nonzero__
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ class GPGTestCase(unittest.TestCase):
|
|||
def test_import_only(self):
|
||||
"""Test that key import works."""
|
||||
self.test_list_keys_initial_public()
|
||||
self.gpg.import_keys(KEYS_TO_IMPORT)
|
||||
self.assertTrue(self.gpg.import_keys(KEYS_TO_IMPORT))
|
||||
public_keys = self.gpg.list_keys()
|
||||
self.assertTrue(is_list_with_len(public_keys, 2),
|
||||
"2-element list expected")
|
||||
|
|
|
|||
Loading…
Reference in New Issue