+9
-4
@@ -2556,10 +2556,15 @@ def validate_datetime(resource_def, datetime_=None):
|
||||
|
||||
te = resource_def['temporal']
|
||||
|
||||
if te['begin'] is not None and te['begin'].tzinfo is None:
|
||||
te['begin'] = te['begin'].replace(tzinfo=pytz.UTC)
|
||||
if te['end'] is not None and te['end'].tzinfo is None:
|
||||
te['end'] = te['end'].replace(tzinfo=pytz.UTC)
|
||||
try:
|
||||
if te['begin'] is not None and te['begin'].tzinfo is None:
|
||||
te['begin'] = te['begin'].replace(tzinfo=pytz.UTC)
|
||||
if te['end'] is not None and te['end'].tzinfo is None:
|
||||
te['end'] = te['end'].replace(tzinfo=pytz.UTC)
|
||||
except AttributeError:
|
||||
msg = 'Configured times should be RFC3339'
|
||||
LOGGER.error(msg)
|
||||
raise ValueError(msg)
|
||||
|
||||
if '/' in datetime_: # envelope
|
||||
LOGGER.debug('detected time range')
|
||||
|
||||
@@ -503,6 +503,11 @@ def test_get_collection_items(config, api_):
|
||||
|
||||
assert code == 200
|
||||
|
||||
rsp_headers, code, response = api_.get_collection_items(
|
||||
req_headers, {'datetime': '2005-04-22'}, 'lakes')
|
||||
|
||||
assert code == 400
|
||||
|
||||
rsp_headers, code, response = api_.get_collection_items(
|
||||
req_headers, {'skipGeometry': 'true'}, 'obs')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user