def setUp(self): global state state = {} self.orig_sleep = time.sleep time.sleep = lambda x: None self.consumer = Consumer(test_invoker, DummyConfiguration) self.handler = TestLogHandler() self.consumer.logger.addHandler(self.handler)
def handle(self, *args, **options): config = load_config('huey.djhuey.conf.Configuration') if options['threads'] is not None: config.THREADS = options['threads'] if options['periodic'] is not None: config.PERIODIC = options['periodic'] self.autodiscover() queue = config.QUEUE result_store = config.RESULT_STORE task_store = config.TASK_STORE invoker = Invoker(queue, result_store, task_store) consumer = Consumer(invoker, config) consumer.run()