Esempio n. 1
0
def test__should_terminate_w_unavailable():
    from google.api_core.exceptions import Cancelled
    from google.cloud.firestore_v1.watch import _should_terminate

    exception = Cancelled("testing")

    assert _should_terminate(exception)
Esempio n. 2
0
 def unit_of_work(txn, *args, **kw):
     called_with.append((txn, args, kw))
     txn.insert(TABLE_NAME, COLUMNS, VALUES)
     raise Cancelled("error")
Esempio n. 3
0
    def test_w_unavailable(self):
        from google.api_core.exceptions import Cancelled

        exception = Cancelled("testing")

        self.assertTrue(self._callFUT(exception))
 async def __aexit__(self, exc_type, exc_val, exc_tb):
     self.fail(Cancelled("Connection shutting down."))
 async def __aexit__(self, exc_type, exc_val, exc_tb):
     self.fail(Cancelled("Connection shutting down."))
     self._loop_task.cancel()
     await wait_ignore_errors(self._loop_task)