~zeitgeist/zeitgeist/trunk-freedesktop

« back to all changes in this revision

Viewing changes to test/dbus/histogram-test.py

  • Committer: crvi
  • Date: 2020-08-13 21:54:56 UTC
  • Revision ID: git-v1:6523379927f7a67dc96897fd5075e427d6d7cb6b
test: port dbus tests to python3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
 
1
#! /usr/bin/env python3
2
2
# -.- coding: utf-8 -.-
3
3
 
4
4
# histogram-test.py
91
91
                ev, ev_timestamp = self._createEventOne();
92
92
                
93
93
                inserted_ids = self.insertEventsAndWait([ev])
94
 
                self.assertEquals(1, len(inserted_ids))
 
94
                self.assertEqual(1, len(inserted_ids))
95
95
                
96
96
                h_data = self.histogram.GetHistogramData()
97
 
                self.assertEquals(1, len(h_data))
 
97
                self.assertEqual(1, len(h_data))
98
98
                
99
99
                h_day_timestamp = h_data[0][0]
100
100
                
101
101
                #Check if the inserted event belong to the right day!
102
102
                day_ev = datetime.date.fromtimestamp(ev_timestamp)
103
103
                start_day = datetime.date.fromtimestamp(h_day_timestamp)
104
 
                self.assertEquals(day_ev.day , start_day.day)
 
104
                self.assertEqual(day_ev.day , start_day.day)
105
105
 
106
106
if __name__ == "__main__":
107
107
        unittest.main()