def test_idle_callback_exception(): class TransientError(Exception): pass error = TransientError("oops") batch = _cache._GlobalCacheBatch() batch.make_call = mock.Mock(side_effect=error) future1, future2 = tasklets.Future(), tasklets.Future() batch.futures = [future1, future2] batch.idle_callback() assert future1.exception() is error assert future2.exception() is error
def test_future_info(): batch = _cache._GlobalCacheBatch() with pytest.raises(NotImplementedError): batch.future_info(None)
def test_make_call(): batch = _cache._GlobalCacheBatch() with pytest.raises(NotImplementedError): batch.make_call()