Skip to content

Commit

Permalink
this technique should really work in all the pythons
Browse files Browse the repository at this point in the history
  • Loading branch information
nlevitt committed May 9, 2017
1 parent ffa6bee commit 32be4af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_certauth.py
Expand Up @@ -5,6 +5,7 @@
import tempfile
from OpenSSL import crypto
import datetime
import time

def setup_module():
global TEST_CA_DIR
Expand Down Expand Up @@ -83,6 +84,7 @@ def test_create_root_subdir():
actual_not_after = datetime.datetime.strptime(
cert.get_notAfter().decode('ascii'), '%Y%m%d%H%M%SZ')

assert abs((actual_not_before.timestamp() - expected_not_before.timestamp())) < 10
assert abs((actual_not_after.timestamp() - expected_not_after.timestamp())) < 10
time.mktime(expected_not_before.utctimetuple())
assert abs((time.mktime(actual_not_before.utctimetuple()) - time.mktime(expected_not_before.utctimetuple()))) < 10
assert abs((time.mktime(actual_not_after.utctimetuple()) - time.mktime(expected_not_after.utctimetuple()))) < 10

0 comments on commit 32be4af

Please sign in to comment.