Ejemplo n.º 1
0
    def test_on_timer_tick(self):
        worker = WorkController(concurrency=1, loglevel=10)

        Timers(worker).on_timer_tick(30.0)
        xargs = self.logger.debug.call_args[0]
        fmt, arg = xargs[0], xargs[1]
        self.assertEqual(30.0, arg)
        self.assertIn('Next eta %s secs', fmt)
Ejemplo n.º 2
0
    def test_on_timer_error(self):
        worker = WorkController(concurrency=1, loglevel=0)

        try:
            raise KeyError('foo')
        except KeyError, exc:
            Timers(worker).on_timer_error(exc)
            msg, args = self.logger.error.call_args[0]
            self.assertIn('KeyError', msg % args)