Verified Commit 3a9c3ca2 by Tulio Casagrande Committed by meskio

[bug] fix expected new_expiry_date

Previously, new_expiry_date was calculated by the key creation date + 1
week, but the proper behavior is today + 1 week, accordingly with gpg
behavior.
parent d16472f0
......@@ -662,16 +662,15 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
yield km.extend_key_expiration(validity='1w')
new_expiry_date = datetime.strptime(
KEY_EXPIRING_CREATION_DATE, '%Y-%m-%d')
new_expiry_date += timedelta(weeks=1)
new_expiry_date = date.today() + timedelta(weeks=1)
renewed_public_key = yield km.get_key(ADDRESS_EXPIRING,
fetch_remote=False)
renewed_private_key = yield km.get_key(ADDRESS_EXPIRING, private=True)
self.assertEqual(new_expiry_date.date(),
self.assertEqual(new_expiry_date,
renewed_public_key.expiry_date.date())
self.assertEqual(new_expiry_date.date(),
self.assertEqual(new_expiry_date,
renewed_private_key.expiry_date.date())
self.assertEqual(key.fingerprint, renewed_public_key.fingerprint)
self.assertEqual(key.fingerprint, renewed_private_key.fingerprint)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment