def _test_comparator_helper(**query_kwargs):
    mock_data()
    results = query_table('change_in_condition',
                          query_index='SavedInRDB',
                          saved_in_rdb=0,
                          **query_kwargs)['Items']

    return [result.get('time') for result in results]
def test_query_sorts():
    mock_data()
    results = query_table('change_in_condition',
                          saved_in_rdb__eq=0,
                          query_index='SavedInRDB')['Items']

    times = [result.get('time') for result in results]
    assert times == [1, 2, 4]
def _test_comparator_helper(**query_kwargs):
    mock_data()
    results = query_table('change_in_condition',
                          query_index='SavedInRDB',
                          saved_in_rdb=0,
                          **query_kwargs)['Items']

    return [result.get('time') for result in results]
def test_query_sorts():
    mock_data()
    results = query_table('change_in_condition',
                          saved_in_rdb__eq=0,
                          query_index='SavedInRDB')['Items']

    times = [result.get('time') for result in results]
    assert times == [1, 2, 4]
def test_mock_query_2_sorts_reverse():
    mock_data()
    results = query_table('change_in_condition',
                          saved_in_rdb__eq=0,
                          query_index='SavedInRDB',
                          descending=True)['Items']

    times = [result.get('time') for result in results]
    assert times == [4, 2, 1]
def test_mock_query_2_sorts_reverse():
    mock_data()
    results = query_table('change_in_condition',
                          saved_in_rdb__eq=0,
                          query_index='SavedInRDB',
                          descending=True)['Items']

    times = [result.get('time') for result in results]
    assert times == [4, 2, 1]
def test_mock_query_count_equal():
    mock_data()
    assert query_table('change_in_condition',
                       saved_in_rdb__eq=0,
                       query_index='SavedInRDB')['Count'] == 3
def test_mock_query_count_equal():
    mock_data()
    assert query_table('change_in_condition',
                       saved_in_rdb__eq=0,
                       query_index='SavedInRDB')['Count'] == 3