Time (#482)
* adding python 3.5 as a target * adding env flag * Aligning on arrow dates.
This commit is contained in:
@ -72,7 +72,9 @@ LEMUR_INSTANCE_PROFILE = 'Lemur'
|
||||
|
||||
DIGICERT_URL = 'https://www.digicert.com'
|
||||
DIGICERT_API_KEY = 'api-key'
|
||||
DIGICERT_ORG_ID = 000000
|
||||
DIGICERT_ORG_ID = 111111
|
||||
DIGICERT_ROOT = "ROOT"
|
||||
DIGICERT_INTERMEDIATE = "INTERMEDIATE"
|
||||
|
||||
|
||||
VERISIGN_URL = 'http://example.com'
|
||||
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals # at top of module
|
||||
import json
|
||||
import pytest
|
||||
import datetime
|
||||
import arrow
|
||||
|
||||
from freezegun import freeze_time
|
||||
|
||||
@ -133,6 +134,8 @@ def test_certificate_input_schema(client, authority):
|
||||
'owner': 'jim@example.com',
|
||||
'authority': {'id': authority.id},
|
||||
'description': 'testtestest',
|
||||
'validityEnd': arrow.get(2016, 11, 9).isoformat(),
|
||||
'validityStart': arrow.get(2015, 11, 9).isoformat()
|
||||
}
|
||||
|
||||
data, errors = CertificateInputSchema().load(input_data)
|
||||
@ -145,7 +148,7 @@ def test_certificate_input_schema(client, authority):
|
||||
assert data['country'] == 'US'
|
||||
assert data['location'] == 'Los Gatos'
|
||||
|
||||
assert len(data.keys()) == 13
|
||||
assert len(data.keys()) == 15
|
||||
|
||||
|
||||
def test_certificate_input_with_extensions(client, authority):
|
||||
|
@ -9,9 +9,9 @@ def test_convert_validity_years(session):
|
||||
with freeze_time("2016-01-01"):
|
||||
data = convert_validity_years(dict(validity_years=2))
|
||||
|
||||
assert data['validity_start'] == arrow.utcnow().date().isoformat()
|
||||
assert data['validity_end'] == arrow.utcnow().replace(years=+2).date().isoformat()
|
||||
assert data['validity_start'] == arrow.utcnow().isoformat()
|
||||
assert data['validity_end'] == arrow.utcnow().replace(years=+2).isoformat()
|
||||
|
||||
with freeze_time("2015-01-10"):
|
||||
data = convert_validity_years(dict(validity_years=1))
|
||||
assert data['validity_end'] == arrow.utcnow().replace(years=+1, days=-2).date().isoformat()
|
||||
assert data['validity_end'] == arrow.utcnow().replace(years=+1, days=-2).isoformat()
|
||||
|
Reference in New Issue
Block a user