def test_store_async_exception(self):
     """Ensure an async exception is encoded correctly."""
     async_id = "asyncid"
     async_result = AsyncResult()
     try:
         raise Exception()
     except Exception, e:
         async_result.payload = encode_exception(e)
         async_result.status = async_result.ERROR
 def test_store_async_exception(self):
     """Ensure an async exception is encoded correctly."""
     async_id = "asyncid"
     async_result = AsyncResult()
     try:
         raise Exception()
     except Exception, e:
         async_result.payload = encode_exception(e)
         async_result.status = async_result.ERROR
 def test_failure_in_marker(self, get_multi_async):
     """Ensure all the results are yielded out when less than the batch
     size and a failure is included in the results.
     """
     async_id = "1"
     async_result = AsyncResult()
     try:
         raise Exception()
     except Exception, e:
         async_result.payload = encode_exception(e)
         async_result.status = async_result.ERROR
 def test_failure_in_marker(self, get_multi_async):
     """Ensure all the results are yielded out when less than the batch
     size and a failure is included in the results.
     """
     async_id = "1"
     async_result = AsyncResult()
     try:
         raise Exception()
     except Exception, e:
         async_result.payload = encode_exception(e)
         async_result.status = async_result.ERROR
    def test_is_error_with_no_callback(self, get_current_async):
        """Ensure an error process with no callback raises the error."""
        from furious.async import Async
        from furious.async import AsyncResult
        from furious.processors import encode_exception
        from furious.processors import _process_results

        async = Mock(spec=Async)

        try:
            raise Exception()
        except Exception, e:
            async.result = AsyncResult(payload=encode_exception(e),
                                       status=AsyncResult.ERROR)