~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:36:48 UTC
  • Revision ID: william.grant@canonical.com-20120122123648-15b1dhwyhin355jp
Fix wsgi to cope with memo changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        self.assertEqual(key, archive_messages[0][1])
86
86
 
87
87
        # The key in archive_message is a TimeUUID for the Date field in
88
 
        # the message. There is no UTC equivalent of time.mktime, so we
89
 
        # must subtract the offset.
 
88
        # the message.
90
89
        utctime = time.mktime(datetime.datetime(
91
 
            2000, 1, 1, 0, 2, 34, tzinfo=tzutc()).timetuple()) - time.timezone
 
90
            2000, 1, 1, 0, 2, 34, tzinfo=tzutc()).timetuple())
92
91
        self.assertEqual(
93
92
            utctime,
94
93
            convert_uuid_to_time(archive_messages[0][0]))
163
162
        self.assertMessages([0, 1], messages)
164
163
        prev, messages, next = conn.get_messages(archive, 'date', 2, next)
165
164
        self.assertMessages([2, 3], messages)
166
 
        prev, messages, next = conn.get_messages(
167
 
            archive, 'date', 2, prev, backward=True)
168
 
        self.assertMessages([0, 1], messages)
169
 
        prev, messages, next = conn.get_messages(
170
 
            archive, 'date', 2, prev, backward=True)
171
 
        self.assertIs(None, prev)
172
 
        self.assertMessages([], messages)
173
 
        self.assertIs(None, next)
 
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)