~ubuntuone-control-tower/software-center/trunk

« back to all changes in this revision

Viewing changes to test/test_apthistory.py

  • Committer: Michael Vogt
  • Date: 2010-10-15 15:30:53 UTC
  • mfrom: (1087.1.31 3.0-history)
  • Revision ID: michael.vogt@ubuntu.com-20101015153053-z9i3jpyd876rdelg
* merged lp:~mvo/software-center/3.0-history to bring back version
  numbers in the upgrade history
* send user default language for "/apps" and "/subscription" requests
  now that the server is ready for this

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        self.assertEqual(history.transactions[0].start_date,
30
30
                         datetime.datetime.strptime("2010-06-09 14:50:00",
31
31
                                                    "%Y-%m-%d  %H:%M:%S"))
32
 
        # 185 is from "zgrep Start data/apt-history/history.log*|wc -l"
 
32
        # 186 is from "zgrep Start data/apt-history/history.log*|wc -l"
33
33
        #print "\n".join([str(x) for x in history.transactions])
34
 
        self.assertEqual(len(history.transactions), 185)
 
34
        self.assertEqual(len(history.transactions), 186)
35
35
 
36
36
 
37
37
    def test_apthistory_upgrade(self):
54
54
        except OSError: 
55
55
            pass
56
56
        history = AptHistory()
57
 
        self.assertEqual(len(history.transactions), 185)
 
57
        self.assertEqual(len(history.transactions), 186)
58
58
        s = open(os.path.join(self.basedir,"history.log")).read()
59
59
        f = open(new_history,"w")
60
60
        for i in range(100):
66
66
            history.rescan()
67
67
        glib.source_remove(timer_id)
68
68
        # verify rescan
69
 
        self.assertTrue(len(history.transactions) > 185)
 
69
        self.assertTrue(len(history.transactions) > 186)
70
70
        # check the timeouts
71
71
        self.assertTrue(len(self._timeouts) > 0)
72
72
        for i in range(len(self._timeouts)-1):