def test_runner_inputs(self): """ The runner function should honor inputs. """ with nested( mock.patch('reworker.worker.pika'), mock.patch('reworker.worker.logging')): sys.argv = ['', 'examples/mqconf.json'] dummy = mock.Mock(worker.Worker) worker.runner(dummy) dummy.assert_called_once_with( json.load(open('examples/mqconf.json', 'r')), config_file=None) assert dummy().run_forever.call_count == 1 # With output dir dummy.reset_mock() sys.argv = ['', 'examples/mqconf.json'] worker.runner(dummy) dummy.assert_called_once_with( json.load(open('examples/mqconf.json', 'r')), config_file=None) assert dummy().run_forever.call_count == 1 # With a worker config dummy.reset_mock() sys.argv = [ '', 'examples/mqconf.json', '-w', 'examples/mqconf.json'] worker.runner(dummy) dummy.assert_called_once_with( json.load(open('examples/mqconf.json', 'r')), config_file='examples/mqconf.json') assert dummy().run_forever.call_count == 1
def main(): # pragma: no cover from reworker.worker import runner runner(SleepWorker)
def main(): # pragma nocover from reworker.worker import runner runner(IRCNotifyWorker)
def main(): # pragma: no cover from reworker.worker import runner runner(OutputWorker)
def main(): # pragma: no cover from reworker.worker import runner runner(HTTPRequestWorker)
def main(): # pragma: no cover logging.getLogger('pika').setLevel(logging.CRITICAL) logging.getLogger('pika.channel').setLevel(logging.CRITICAL) from reworker.worker import runner runner(JuicerWorker)
def main(): # pragma nocover from reworker.worker import runner runner(NagiosWorker)
def main(): # pragma: no cover from reworker.worker import runner runner(ServiceNowWorker)
def main(): # pragma: no cover from reworker.worker import runner runner(NoopWorker)
def main(): # pragma: no cover from reworker.worker import runner runner(Satellite5Worker)