def test_success_tell_manager(self): worker = NowcastWorker("worker_name", "description") worker.init_cli() worker.logger = Mock(name="logger") worker.tell_manager = Mock(name="tell_manager") worker.worker_func = Mock(name="worker_func", return_value="checklist") worker.success = Mock(name="success_func", return_value="success") worker._do_work() worker.tell_manager.assert_called_once_with("success", "checklist")
def test_success_func(self): worker = NowcastWorker("worker_name", "description") worker.init_cli() worker.logger = Mock(name="logger") worker.tell_manager = Mock(name="tell_manager") worker.worker_func = Mock(name="worker_func") worker.success = Mock(name="success_func") worker._do_work() worker.success.assert_called_once_with(worker._parsed_args)