162
162
self.assertMessages([0, 1], messages)
163
163
prev, messages, next = conn.get_messages(archive, 'date', 2, next)
164
164
self.assertMessages([2, 3], messages)
165
# XXX: We shouldn't have to reverse the sort order. There should
166
# be a flag to work backwards, but I'm not sure if we can get
167
# that from Cassandra without reversing in Python.
168
prev, messages, next = conn.get_messages(archive, '-date', 2, prev)
169
self.assertMessages([1, 0], messages)
165
prev, messages, next = conn.get_messages(
166
archive, 'date', 2, prev, backward=True)
167
self.assertMessages([0, 1], messages)
168
prev, messages, next = conn.get_messages(
169
archive, 'date', 2, prev, backward=True)
170
self.assertIs(None, prev)
171
self.assertMessages([], messages)
172
self.assertIs(None, next)