def test_get_time_range() -> None:
    '\n    Test finding the time range of a query.\n    '
    body = {'selected_columns': ['event_id'], 'conditions': [('timestamp', '>=', '2019-09-18T10:00:00'), ('timestamp', '>=', '2000-09-18T10:00:00'), ('timestamp', '<', '2019-09-19T12:00:00'), [('timestamp', '<', '2019-09-18T12:00:00'), ('project_id', 'IN', [1])], ('project_id', 'IN', [1])]}
    events = get_dataset('events')
    query = parse_query(body, events)
    processors = events.get_default_entity().get_query_processors()
    for processor in processors:
        if isinstance(processor, TimeSeriesProcessor):
            processor.process_query(query, HTTPRequestSettings())
    (from_date_ast, to_date_ast) = get_time_range(identity_translate(query), 'timestamp')
    assert ((from_date_ast is not None) and isinstance(from_date_ast, datetime) and (from_date_ast.isoformat() == '2019-09-18T10:00:00'))
    assert ((to_date_ast is not None) and isinstance(to_date_ast, datetime) and (to_date_ast.isoformat() == '2019-09-19T12:00:00'))
Test finding the time range of a query.
def test_get_time_range() -> None:
    '\n    \n    '
    body = {'selected_columns': ['event_id'], 'conditions': [('timestamp', '>=', '2019-09-18T10:00:00'), ('timestamp', '>=', '2000-09-18T10:00:00'), ('timestamp', '<', '2019-09-19T12:00:00'), [('timestamp', '<', '2019-09-18T12:00:00'), ('project_id', 'IN', [1])], ('project_id', 'IN', [1])]}
    events = get_dataset('events')
    query = parse_query(body, events)
    processors = events.get_default_entity().get_query_processors()
    for processor in processors:
        if isinstance(processor, TimeSeriesProcessor):
            processor.process_query(query, HTTPRequestSettings())
    (from_date_ast, to_date_ast) = get_time_range(identity_translate(query), 'timestamp')
    assert ((from_date_ast is not None) and isinstance(from_date_ast, datetime) and (from_date_ast.isoformat() == '2019-09-18T10:00:00'))
    assert ((to_date_ast is not None) and isinstance(to_date_ast, datetime) and (to_date_ast.isoformat() == '2019-09-19T12:00:00'))