some gpg improvements; hopefully this will be a little more version resilient

This commit is contained in:
Michael Greene
2016-12-20 14:32:26 -08:00
parent 5d08583856
commit 761637d395
2 changed files with 29 additions and 12 deletions

View File

@@ -373,7 +373,7 @@ class TestPGPKey(object):
# add all of the subpackets we should be allowed to
sig = sec.sign(string,
user=sec.userids[0].name,
expires=timedelta(seconds=1),
expires=timedelta(seconds=30),
revocable=False,
notation={'Testing': 'This signature was generated during unit testing'},
policy_uri='about:blank')
@@ -385,9 +385,10 @@ class TestPGPKey(object):
assert sig.policy_uri == 'about:blank'
# assert sig.sig.signer_uid == "{:s}".format(sec.userids[0])
assert next(iter(sig._signature.subpackets['SignersUserID'])).userid == "{:s}".format(sec.userids[0])
if not sig.is_expired:
time.sleep((sig.expires_at - datetime.utcnow()).total_seconds())
assert sig.is_expired
# TODO: move this to another test
# if not sig.is_expired:
# time.sleep((sig.expires_at - datetime.utcnow()).total_seconds())
# assert sig.is_expired
# verify with GnuPG
if sig.key_algorithm not in {PubKeyAlgorithm.ECDSA}: