def test_prepare_time_range_with_iso_dates(): leql_time_range = api.prepare_time_range(None, None, relative_time_range=None, date_from='1970-01-01 00:00:00', date_to='1970-01-01 00:00:00') assert 'from' in leql_time_range assert 'to' in leql_time_range assert 'time_range' not in leql_time_range
def test_prepare_time_range_from_to(): leql_time_range = api.prepare_time_range(time_from=1, time_to=2, relative_time_range=None) assert 'from' in leql_time_range assert 'to' in leql_time_range assert leql_time_range['from'] == 1 * 1000 assert leql_time_range['to'] == 2 * 1000 assert 'time_range' not in leql_time_range
def test_prepare_time_range_relative_range(): leql_time_range = api.prepare_time_range(None, None, relative_time_range='last 10 min') assert 'from' not in leql_time_range assert 'to' not in leql_time_range assert 'time_range' in leql_time_range assert leql_time_range['time_range'] == 'last 10 min'