Example #1
0
    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
Example #2
0
 def test_future_info():
     batch = _cache._GlobalCacheBatch()
     with pytest.raises(NotImplementedError):
         batch.future_info(None)
Example #3
0
 def test_make_call():
     batch = _cache._GlobalCacheBatch()
     with pytest.raises(NotImplementedError):
         batch.make_call()