summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveev <stargrave@stargrave.org>2020-05-07 20:07:03 +0300
committerSergey Matveev <stargrave@stargrave.org>2020-05-07 20:07:05 +0300
commit3263b452168d49d704506ba5c258186f3aeea253 (patch)
treeab9d00b2d4248540deb2bd73956af61bd61102a7
parente45586a0a592eeac8a10c265117b803732201eb5 (diff)
downloadpyderasn-3263b452168d49d704506ba5c258186f3aeea253.tar.xz
Fix test failing on Windows: it does not support negative timestamps
-rw-r--r--tests/test_pyderasn.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_pyderasn.py b/tests/test_pyderasn.py
index 90d50e9..c6621c9 100644
--- a/tests/test_pyderasn.py
+++ b/tests/test_pyderasn.py
@@ -4495,8 +4495,13 @@ class TestGeneralizedTime(TimeMixin, CommonMixin, TestCase):
mktime(obj.todatetime().timetuple()),
mktime(dt.timetuple()),
)
- elif not PY2:
- self.assertEqual(obj.todatetime().timestamp(), dt.timestamp())
+ else:
+ try:
+ obj.todatetime().timestamp()
+ except:
+ pass
+ else:
+ self.assertEqual(obj.todatetime().timestamp(), dt.timestamp())
self.assertEqual(obj.ber_encoded, not dered)
self.assertEqual(obj.bered, not dered)
self.assertEqual(obj.ber_raw, None if dered else data)