def test_reverse_queries(testbed):
    for i in range(11):
        Bar().put()

    (bars, cursor, more), (r_bars, r_cursor, r_more) = snippets.reverse_queries()

    assert len(bars) == 10
    assert len(r_bars) == 10

    for prev_bar, bar in zip(bars, bars[1:]):
        assert prev_bar.key < bar.key

    for prev_bar, bar in zip(r_bars, r_bars[1:]):
        assert prev_bar.key > bar.key
def test_reverse_queries(testbed):
    for i in range(11):
        Bar().put()

    (bars, cursor, more), (r_bars, r_cursor,
                           r_more) = (snippets.reverse_queries())

    assert len(bars) == 10
    assert len(r_bars) == 10

    for prev_bar, bar in zip(bars, bars[1:]):
        assert prev_bar.key < bar.key

    for prev_bar, bar in zip(r_bars, r_bars[1:]):
        assert prev_bar.key > bar.key
def test_reverse_queries(testbed):
    for i in range(11):
        Bar().put()

    (bars, cursor, more), (r_bars, r_cursor, r_more) = (
        snippets.reverse_queries())

    if len(bars) != 10:
        raise AssertionError
    if len(r_bars) != 10:
        raise AssertionError

    for prev_bar, bar in zip(bars, bars[1:]):
        if prev_bar.key >= bar.key:
            raise AssertionError

    for prev_bar, bar in zip(r_bars, r_bars[1:]):
        if prev_bar.key <= bar.key:
            raise AssertionError