示例#1
0
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
示例#2
0
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
示例#3
0
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'
示例#4
0
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
示例#5
0
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
示例#6
0
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'