~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-23 00:15:41 UTC
  • Revision ID: william.grant@canonical.com-20120123001541-opi3ememu13hg9jy
Use real UTC timestamps in the archive_message TimeUUIDs. pycassa's end up including the local timezone offset :/

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.
 
88
        # the message. There is no UTC equivalent of time.mktime, so we
 
89
        # must subtract the offset.
89
90
        utctime = time.mktime(datetime.datetime(
90
 
            2000, 1, 1, 0, 2, 34, tzinfo=tzutc()).timetuple())
 
91
            2000, 1, 1, 0, 2, 34, tzinfo=tzutc()).timetuple()) - time.timezone
91
92
        self.assertEqual(
92
93
            utctime,
93
94
            convert_uuid_to_time(archive_messages[0][0]))