def test_context_checker_encoded(self): """Ensure the _context_checker is correctly encoded in options dict.""" from furious.async import Async from furious.async import encode_async_options async_job = Async("something", _context_checker=dir) options = encode_async_options(async_job) self.assertEqual("dir", options["__context_checker"])
def test_context_checker_encoded(self): """Ensure the _context_checker is correctly encoded in options dict.""" from furious. async import Async from furious. async import encode_async_options async_job = Async("something", _context_checker=dir) options = encode_async_options(async_job) self.assertEqual('dir', options['__context_checker'])
def test_retry_value_without_to_task(self): """Ensure that when you encode the options, the retry_options are not affected. """ from furious.async import Async from furious.async import encode_async_options async_job = Async("something", task_args={"retry_options": {"task_retry_limit": 5}}) options = encode_async_options(async_job) self.assertEqual(5, options["task_args"]["retry_options"]["task_retry_limit"])
def test_retry_value_with_to_task(self): """Ensure that calling to_task doesn't affect the options when encoding. """ from furious.async import Async from furious.async import encode_async_options async_job = Async("something", task_args={"retry_options": {"task_retry_limit": 5}}) async_job.to_task() options = encode_async_options(async_job) self.assertEqual(5, options["task_args"]["retry_options"]["task_retry_limit"])
def test_retry_value_without_to_task(self): """Ensure that when you encode the options, the retry_options are not affected. """ from furious. async import Async from furious. async import encode_async_options async_job = Async("something", task_args={'retry_options': { 'task_retry_limit': 5 }}) options = encode_async_options(async_job) self.assertEqual( 5, options['task_args']['retry_options']['task_retry_limit'])
def test_retry_value_with_to_task(self): """Ensure that calling to_task doesn't affect the options when encoding. """ from furious. async import Async from furious. async import encode_async_options async_job = Async("something", task_args={'retry_options': { 'task_retry_limit': 5 }}) async_job.to_task() options = encode_async_options(async_job) self.assertEqual( 5, options['task_args']['retry_options']['task_retry_limit'])