~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/tests/test_model.py

  • Committer: William Grant
  • Date: 2012-01-22 12:46:24 UTC
  • Revision ID: william.grant@canonical.com-20120122124624-of899x94i30q946p
Do backward correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)