Esempio n. 1
0
    def test_index_latest(self):
        self.create_switch("local-statistics-processing")
        latest = datetime.date.today() - datetime.timedelta(days=5)
        UpdateCount.index({"date": latest})
        self.refresh("stats")

        start = latest.strftime("%Y-%m-%d")
        finish = datetime.date.today().strftime("%Y-%m-%d")
        with mock.patch("olympia.stats.cron.call_command") as call:
            cron.index_latest_stats()
            call.assert_called_with("index_stats", addons=None, date="%s:%s" % (start, finish))
Esempio n. 2
0
    def test_index_latest(self):
        self.create_switch('local-statistics-processing')
        latest = datetime.date.today() - datetime.timedelta(days=5)
        UpdateCount.index({'date': latest})
        self.refresh('stats')

        start = latest.strftime('%Y-%m-%d')
        finish = datetime.date.today().strftime('%Y-%m-%d')
        with mock.patch('olympia.stats.cron.call_command') as call:
            cron.index_latest_stats()
            call.assert_called_with('index_stats', addons=None,
                                    date='%s:%s' % (start, finish))