コード例 #1
0
ファイル: test__cache.py プロジェクト: chrisrossi/python-ndb
    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
コード例 #2
0
ファイル: test__cache.py プロジェクト: schwehr/python-ndb
 def test_future_info():
     batch = _cache._GlobalCacheBatch()
     with pytest.raises(NotImplementedError):
         batch.future_info(None)
コード例 #3
0
ファイル: test__cache.py プロジェクト: schwehr/python-ndb
 def test_make_call():
     batch = _cache._GlobalCacheBatch()
     with pytest.raises(NotImplementedError):
         batch.make_call()