lists.arthurdejong.org
RSS feed

python-pskc branch master updated. 1.2-16-gd790ba4

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-pskc branch master updated. 1.2-16-gd790ba4



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-pskc".

The branch, master has been updated
       via  d790ba4847614ed23086a0d0bece412974a5b41d (commit)
      from  c002d92df42398987bd08947cdc4fcbef6295872 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-pskc/commit/?id=d790ba4847614ed23086a0d0bece412974a5b41d

commit d790ba4847614ed23086a0d0bece412974a5b41d
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Sep 8 18:48:14 2024 +0200

    Remove tests reliance on current time
    
    This ensures that the tests that compare the current time to expiry
    times should either set an explicity current time or use values relative
    to the current time.

diff --git a/tests/test_misc.doctest b/tests/test_misc.doctest
index a036712..f135517 100644
--- a/tests/test_misc.doctest
+++ b/tests/test_misc.doctest
@@ -1,6 +1,6 @@
 test_misc.doctest - miscellaneous tests
 
-Copyright (C) 2014-2017 Arthur de Jong
+Copyright (C) 2014-2024 Arthur de Jong
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -207,21 +207,18 @@ datetime.datetime(2026, 5, 31, 0, 0, tzinfo=tzutc())
 ['OTP']
 >>> key.policy.unknown_policy_elements
 False
->>> key.policy.may_use()
-True
 >>> key.policy.may_use('OTP', datetime.datetime(2005, 4, 3, 0, 0, 0))
 False
 >>> key.policy.may_use('OTP', now)
 True
 >>> key.policy.may_use('OTP', datetime.datetime(2028, 12, 31, 0, 0, 0))
 False
->>> key.policy.start_date = datetime.datetime.now() + \
-...     datetime.timedelta(seconds=10)
->>> key.policy.may_use('OTP')
+>>> key.policy.start_date = datetime.datetime.now() + 
datetime.timedelta(seconds=10)
+>>> key.policy.expiry_date = datetime.datetime.now() + 
datetime.timedelta(days=1)
+>>> key.policy.may_use()
 False
->>> key.policy.start_date = datetime.datetime.now(dateutil.tz.tzlocal()) - \
-...     datetime.timedelta(seconds=10)
->>> key.policy.may_use('OTP')
+>>> key.policy.start_date = datetime.datetime.now() - 
datetime.timedelta(seconds=10)
+>>> key.policy.may_use()
 True
 >>> key = pskc.keys[1]
 >>> key.policy.key_usage

-----------------------------------------------------------------------

Summary of changes:
 tests/test_misc.doctest | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
python-pskc