Hello community,

here is the log from the commit of package python-google-api-core for 
openSUSE:Factory checked in at 2019-08-13 13:25:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-google-api-core (Old)
 and      /work/SRC/openSUSE:Factory/.python-google-api-core.new.9556 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-google-api-core"

Tue Aug 13 13:25:02 2019 rev:10 rq:722805 version:1.14.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-google-api-core/python-google-api-core.changes
    2019-07-04 15:43:02.814088156 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-google-api-core.new.9556/python-google-api-core.changes
  2019-08-13 13:25:04.873358120 +0200
@@ -1,0 +2,9 @@
+Mon Aug 12 14:15:35 UTC 2019 - Marketa Calabkova <[email protected]>
+
+- Update to 1.14.2
+  * Forward ‘timeout’ arg from ‘exception’ to _blocking_poll.
+  * Update intersphinx mapping for requests. 
+  * Firestore: Add should_terminate predicate for clean BiDi shutdown.
+  * Update pins of ‘googleapis-common-protos. 
+
+-------------------------------------------------------------------

Old:
----
  google-api-core-1.13.0.tar.gz

New:
----
  google-api-core-1.14.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-google-api-core.spec ++++++
--- /var/tmp/diff_new_pack.nzaMu3/_old  2019-08-13 13:25:05.645357917 +0200
+++ /var/tmp/diff_new_pack.nzaMu3/_new  2019-08-13 13:25:05.649357916 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-google-api-core
-Version:        1.13.0
+Version:        1.14.2
 Release:        0
 Summary:        Google API client core library
 License:        Apache-2.0
@@ -26,11 +26,11 @@
 URL:            https://github.com/GoogleCloudPlatform/google-cloud-python
 Source:         
https://files.pythonhosted.org/packages/source/g/google-api-core/google-api-core-%{version}.tar.gz
 BuildRequires:  %{python_module google-auth >= 0.4.0}
-BuildRequires:  %{python_module googleapis-common-protos >= 1.5.3}
+BuildRequires:  %{python_module googleapis-common-protos >= 1.6.0}
 BuildRequires:  %{python_module grpcio >= 1.8.2}
 BuildRequires:  %{python_module grpcio-gcp >= 0.2.2}
 BuildRequires:  %{python_module mock}
-BuildRequires:  %{python_module protobuf}
+BuildRequires:  %{python_module protobuf >= 3.4.0}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module pytz}
 BuildRequires:  %{python_module requests >= 2.18.0}
@@ -38,12 +38,10 @@
 BuildRequires:  %{python_module six >= 1.10.0}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-BuildRequires:  python2-enum34
-BuildRequires:  python2-futures >= 3.2.0
 Requires:       python-google-auth >= 0.4.0
-Requires:       python-googleapis-common-protos >= 1.5.3
+Requires:       python-googleapis-common-protos >= 1.6.0
 Requires:       python-grpcio >= 1.8.2
-Requires:       python-protobuf >= 3.0.0
+Requires:       python-protobuf >= 3.4.0
 Requires:       python-pytz
 Requires:       python-requests >= 2.18.0
 Requires:       python-setuptools >= 34.0.0
@@ -52,7 +50,7 @@
 BuildArch:      noarch
 %ifpython2
 BuildRequires:  python2-enum34
-BuildRequires:  python2-futures
+BuildRequires:  python2-futures >= 3.2.0
 %endif
 %ifpython2
 Requires:       python-enum34

++++++ google-api-core-1.13.0.tar.gz -> google-api-core-1.14.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-api-core-1.13.0/PKG-INFO 
new/google-api-core-1.14.2/PKG-INFO
--- old/google-api-core-1.13.0/PKG-INFO 2019-06-24 23:08:07.000000000 +0200
+++ new/google-api-core-1.14.2/PKG-INFO 2019-07-31 01:27:20.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: google-api-core
-Version: 1.13.0
+Version: 1.14.2
 Summary: Google API client core library
 Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
 Author: Google LLC
@@ -9,7 +9,7 @@
 Description: Core Library for Google Client Libraries
         ========================================
         
-        |pypi| |versions|
+        |pypi| |versions| |compat_check_pypi| |compat_check_github|
         
         This library is not meant to stand-alone. Instead it defines
         common helpers used by all Google API clients. For more information, 
see the
@@ -19,7 +19,11 @@
            :target: https://pypi.org/project/google-api_core/
         .. |versions| image:: 
https://img.shields.io/pypi/pyversions/google-api_core.svg
            :target: https://pypi.org/project/google-api_core/
-        .. _documentation: 
https://googleapis.github.io/google-cloud-python/latest/core/
+        .. _documentation: https://googleapis.dev/python/google-api-core/latest
+        .. |compat_check_pypi| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-api-core
+           :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-api-core
+        .. |compat_check_github| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
+           :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
         
         
         Supported Python Versions
@@ -29,6 +33,7 @@
         Deprecated Python Versions
         --------------------------
         Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+        
 Platform: Posix; MacOS X; Windows
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-api-core-1.13.0/README.rst 
new/google-api-core-1.14.2/README.rst
--- old/google-api-core-1.13.0/README.rst       2019-06-24 23:05:41.000000000 
+0200
+++ new/google-api-core-1.14.2/README.rst       2019-07-31 01:24:12.000000000 
+0200
@@ -1,7 +1,7 @@
 Core Library for Google Client Libraries
 ========================================
 
-|pypi| |versions|
+|pypi| |versions| |compat_check_pypi| |compat_check_github|
 
 This library is not meant to stand-alone. Instead it defines
 common helpers used by all Google API clients. For more information, see the
@@ -11,7 +11,11 @@
    :target: https://pypi.org/project/google-api_core/
 .. |versions| image:: 
https://img.shields.io/pypi/pyversions/google-api_core.svg
    :target: https://pypi.org/project/google-api_core/
-.. _documentation: 
https://googleapis.github.io/google-cloud-python/latest/core/
+.. _documentation: https://googleapis.dev/python/google-api-core/latest
+.. |compat_check_pypi| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-api-core
+   :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-api-core
+.. |compat_check_github| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
+   :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
 
 
 Supported Python Versions
@@ -20,4 +24,4 @@
 
 Deprecated Python Versions
 --------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
\ No newline at end of file
+Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-api-core-1.13.0/google/api_core/bidi.py 
new/google-api-core-1.14.2/google/api_core/bidi.py
--- old/google-api-core-1.13.0/google/api_core/bidi.py  2019-06-24 
23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/google/api_core/bidi.py  2019-07-31 
01:24:12.000000000 +0200
@@ -349,6 +349,11 @@
         return self._request_queue.qsize()
 
 
+def _never_terminate(future_or_error):
+    """By default, no errors cause BiDi termination."""
+    return False
+
+
 class ResumableBidiRpc(BidiRpc):
     """A :class:`BidiRpc` that can automatically resume the stream on errors.
 
@@ -391,6 +396,9 @@
         should_recover (Callable[[Exception], bool]): A function that returns
             True if the stream should be recovered. This will be called
             whenever an error is encountered on the stream.
+        should_terminate (Callable[[Exception], bool]): A function that returns
+            True if the stream should be terminated. This will be called
+            whenever an error is encountered on the stream.
         metadata Sequence[Tuple(str, str)]: RPC metadata to include in
             the request.
         throttle_reopen (bool): If ``True``, throttling will be applied to
@@ -401,12 +409,14 @@
         self,
         start_rpc,
         should_recover,
+        should_terminate=_never_terminate,
         initial_request=None,
         metadata=None,
         throttle_reopen=False,
     ):
         super(ResumableBidiRpc, self).__init__(start_rpc, initial_request, 
metadata)
         self._should_recover = should_recover
+        self._should_terminate = should_terminate
         self._operational_lock = threading.RLock()
         self._finalized = False
         self._finalize_lock = threading.Lock()
@@ -433,7 +443,9 @@
         # error, not for errors that we can recover from. Note that grpc's
         # "future" here is also a grpc.RpcError.
         with self._operational_lock:
-            if not self._should_recover(future):
+            if self._should_terminate(future):
+                self._finalize(future)
+            elif not self._should_recover(future):
                 self._finalize(future)
             else:
                 _LOGGER.debug("Re-opening stream from gRPC callback.")
@@ -496,6 +508,12 @@
                 with self._operational_lock:
                     _LOGGER.debug("Call to retryable %r caused %s.", method, 
exc)
 
+                    if self._should_terminate(exc):
+                        self.close()
+                        _LOGGER.debug("Terminating %r due to %s.", method, exc)
+                        self._finalize(exc)
+                        break
+
                     if not self._should_recover(exc):
                         self.close()
                         _LOGGER.debug("Not retrying %r due to %s.", method, 
exc)
@@ -651,9 +669,6 @@
                 exc,
             )
 
-        else:
-            _LOGGER.error("The bidirectional RPC exited.")
-
         _LOGGER.info("%s exiting", _BIDIRECTIONAL_CONSUMER_NAME)
 
     def start(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-api-core-1.13.0/google/api_core/client_options.py 
new/google-api-core-1.14.2/google/api_core/client_options.py
--- old/google-api-core-1.13.0/google/api_core/client_options.py        
2019-06-24 23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/google/api_core/client_options.py        
2019-07-31 01:24:12.000000000 +0200
@@ -16,6 +16,27 @@
 
 Client options provide a consistent interface for user options to be defined
 across clients.
+
+You can pass a client options object to a client.
+
+.. code-block:: python
+
+    from google.api_core.client_options import ClientOptions
+    from google.cloud.vision_v1 import ImageAnnotatorClient
+
+    options = ClientOptions(api_endpoint="foo.googleapis.com")
+
+    client = ImageAnnotatorClient(client_options=options)
+
+You can also pass a dictionary.
+
+.. code-block:: python
+
+    from google.cloud.vision_v1 import ImageAnnotatorClient
+
+    client = ImageAnnotatorClient(client_options={"api_endpoint": 
"foo.googleapis.com"})
+
+
 """
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-api-core-1.13.0/google/api_core/future/polling.py 
new/google-api-core-1.14.2/google/api_core/future/polling.py
--- old/google-api-core-1.13.0/google/api_core/future/polling.py        
2019-06-24 23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/google/api_core/future/polling.py        
2019-07-31 01:24:12.000000000 +0200
@@ -45,7 +45,7 @@
     behavior will repeatedly call ``done`` until it returns True.
 
     .. note: Privacy here is intended to prevent the final class from
-    overexposing, not to prevent subclasses from accessing methods.
+      overexposing, not to prevent subclasses from accessing methods.
 
     Args:
         retry (google.api_core.retry.Retry): The retry configuration used
@@ -139,7 +139,7 @@
             Optional[google.api_core.GoogleAPICallError]: The operation's
                 error.
         """
-        self._blocking_poll()
+        self._blocking_poll(timeout=timeout)
         return self._exception
 
     def add_done_callback(self, fn):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-api-core-1.13.0/google_api_core.egg-info/PKG-INFO 
new/google-api-core-1.14.2/google_api_core.egg-info/PKG-INFO
--- old/google-api-core-1.13.0/google_api_core.egg-info/PKG-INFO        
2019-06-24 23:08:06.000000000 +0200
+++ new/google-api-core-1.14.2/google_api_core.egg-info/PKG-INFO        
2019-07-31 01:27:20.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: google-api-core
-Version: 1.13.0
+Version: 1.14.2
 Summary: Google API client core library
 Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
 Author: Google LLC
@@ -9,7 +9,7 @@
 Description: Core Library for Google Client Libraries
         ========================================
         
-        |pypi| |versions|
+        |pypi| |versions| |compat_check_pypi| |compat_check_github|
         
         This library is not meant to stand-alone. Instead it defines
         common helpers used by all Google API clients. For more information, 
see the
@@ -19,7 +19,11 @@
            :target: https://pypi.org/project/google-api_core/
         .. |versions| image:: 
https://img.shields.io/pypi/pyversions/google-api_core.svg
            :target: https://pypi.org/project/google-api_core/
-        .. _documentation: 
https://googleapis.github.io/google-cloud-python/latest/core/
+        .. _documentation: https://googleapis.dev/python/google-api-core/latest
+        .. |compat_check_pypi| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-api-core
+           :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-api-core
+        .. |compat_check_github| image:: 
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
+           :target: 
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dapi_core
         
         
         Supported Python Versions
@@ -29,6 +33,7 @@
         Deprecated Python Versions
         --------------------------
         Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+        
 Platform: Posix; MacOS X; Windows
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-api-core-1.13.0/google_api_core.egg-info/requires.txt 
new/google-api-core-1.14.2/google_api_core.egg-info/requires.txt
--- old/google-api-core-1.13.0/google_api_core.egg-info/requires.txt    
2019-06-24 23:08:06.000000000 +0200
+++ new/google-api-core-1.14.2/google_api_core.egg-info/requires.txt    
2019-07-31 01:27:20.000000000 +0200
@@ -1,4 +1,4 @@
-googleapis-common-protos!=1.5.4,<2.0dev,>=1.5.3
+googleapis-common-protos<2.0dev,>=1.6.0
 protobuf>=3.4.0
 google-auth<2.0dev,>=0.4.0
 requests<3.0.0dev,>=2.18.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-api-core-1.13.0/setup.py 
new/google-api-core-1.14.2/setup.py
--- old/google-api-core-1.13.0/setup.py 2019-06-24 23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/setup.py 2019-07-31 01:24:12.000000000 +0200
@@ -22,14 +22,14 @@
 
 name = "google-api-core"
 description = "Google API client core library"
-version = "1.13.0"
+version = "1.14.2"
 # Should be one of:
 # 'Development Status :: 3 - Alpha'
 # 'Development Status :: 4 - Beta'
 # 'Development Status :: 5 - Production/Stable'
 release_status = "Development Status :: 5 - Production/Stable"
 dependencies = [
-    "googleapis-common-protos >= 1.5.3, != 1.5.4, < 2.0dev",
+    "googleapis-common-protos >= 1.6.0, < 2.0dev",
     "protobuf >= 3.4.0",
     "google-auth >= 0.4.0, < 2.0dev",
     "requests >= 2.18.0, < 3.0.0dev",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/google-api-core-1.13.0/tests/unit/future/test_polling.py 
new/google-api-core-1.14.2/tests/unit/future/test_polling.py
--- old/google-api-core-1.13.0/tests/unit/future/test_polling.py        
2019-06-24 23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/tests/unit/future/test_polling.py        
2019-07-31 01:24:12.000000000 +0200
@@ -119,6 +119,12 @@
         future.result(timeout=1)
 
 
+def test_exception_timeout():
+    future = PollingFutureImplTimeout()
+    with pytest.raises(concurrent.futures.TimeoutError):
+        future.exception(timeout=1)
+
+
 class PollingFutureImplTransient(PollingFutureImplWithPoll):
     def __init__(self, errors):
         super(PollingFutureImplTransient, self).__init__()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/google-api-core-1.13.0/tests/unit/test_bidi.py 
new/google-api-core-1.14.2/tests/unit/test_bidi.py
--- old/google-api-core-1.13.0/tests/unit/test_bidi.py  2019-06-24 
23:05:41.000000000 +0200
+++ new/google-api-core-1.14.2/tests/unit/test_bidi.py  2019-07-31 
01:24:12.000000000 +0200
@@ -370,16 +370,65 @@
 
 
 class TestResumableBidiRpc(object):
-    def test_initial_state(self):
-        callback = mock.Mock()
-        callback.return_value = True
-        bidi_rpc = bidi.ResumableBidiRpc(None, callback)
+    def test_ctor_defaults(self):
+        start_rpc = mock.Mock()
+        should_recover = mock.Mock()
+        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover)
 
         assert bidi_rpc.is_active is False
+        assert bidi_rpc._finalized is False
+        assert bidi_rpc._start_rpc is start_rpc
+        assert bidi_rpc._should_recover is should_recover
+        assert bidi_rpc._should_terminate is bidi._never_terminate
+        assert bidi_rpc._initial_request is None
+        assert bidi_rpc._rpc_metadata is None
+        assert bidi_rpc._reopen_throttle is None
+
+    def test_ctor_explicit(self):
+        start_rpc = mock.Mock()
+        should_recover = mock.Mock()
+        should_terminate = mock.Mock()
+        initial_request = mock.Mock()
+        metadata = {"x-foo": "bar"}
+        bidi_rpc = bidi.ResumableBidiRpc(
+            start_rpc,
+            should_recover,
+            should_terminate=should_terminate,
+            initial_request=initial_request,
+            metadata=metadata,
+            throttle_reopen=True,
+        )
+
+        assert bidi_rpc.is_active is False
+        assert bidi_rpc._finalized is False
+        assert bidi_rpc._should_recover is should_recover
+        assert bidi_rpc._should_terminate is should_terminate
+        assert bidi_rpc._initial_request is initial_request
+        assert bidi_rpc._rpc_metadata == metadata
+        assert isinstance(bidi_rpc._reopen_throttle, bidi._Throttle)
+
+    def test_done_callbacks_terminate(self):
+        cancellation = mock.Mock()
+        start_rpc = mock.Mock()
+        should_recover = mock.Mock(spec=["__call__"], return_value=True)
+        should_terminate = mock.Mock(spec=["__call__"], return_value=True)
+        bidi_rpc = bidi.ResumableBidiRpc(
+            start_rpc, should_recover, should_terminate=should_terminate
+        )
+        callback = mock.Mock(spec=["__call__"])
+
+        bidi_rpc.add_done_callback(callback)
+        bidi_rpc._on_call_done(cancellation)
+
+        should_terminate.assert_called_once_with(cancellation)
+        should_recover.assert_not_called()
+        callback.assert_called_once_with(cancellation)
+        assert not bidi_rpc.is_active
 
     def test_done_callbacks_recoverable(self):
         start_rpc = mock.create_autospec(grpc.StreamStreamMultiCallable, 
instance=True)
-        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, lambda _: True)
+        should_recover = mock.Mock(spec=["__call__"], return_value=True)
+        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover)
         callback = mock.Mock(spec=["__call__"])
 
         bidi_rpc.add_done_callback(callback)
@@ -387,16 +436,45 @@
 
         callback.assert_not_called()
         start_rpc.assert_called_once()
+        should_recover.assert_called_once_with(mock.sentinel.future)
         assert bidi_rpc.is_active
 
     def test_done_callbacks_non_recoverable(self):
-        bidi_rpc = bidi.ResumableBidiRpc(None, lambda _: False)
+        start_rpc = mock.create_autospec(grpc.StreamStreamMultiCallable, 
instance=True)
+        should_recover = mock.Mock(spec=["__call__"], return_value=False)
+        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover)
         callback = mock.Mock(spec=["__call__"])
 
         bidi_rpc.add_done_callback(callback)
         bidi_rpc._on_call_done(mock.sentinel.future)
 
         callback.assert_called_once_with(mock.sentinel.future)
+        should_recover.assert_called_once_with(mock.sentinel.future)
+        assert not bidi_rpc.is_active
+
+    def test_send_terminate(self):
+        cancellation = ValueError()
+        call_1 = CallStub([cancellation], active=False)
+        call_2 = CallStub([])
+        start_rpc = mock.create_autospec(
+            grpc.StreamStreamMultiCallable, instance=True, 
side_effect=[call_1, call_2]
+        )
+        should_recover = mock.Mock(spec=["__call__"], return_value=False)
+        should_terminate = mock.Mock(spec=["__call__"], return_value=True)
+        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, 
should_terminate=should_terminate)
+
+        bidi_rpc.open()
+
+        bidi_rpc.send(mock.sentinel.request)
+
+        assert bidi_rpc.pending_requests == 1
+        assert bidi_rpc._request_queue.get() is None
+
+        should_recover.assert_not_called()
+        should_terminate.assert_called_once_with(cancellation)
+        assert bidi_rpc.call == call_1
+        assert bidi_rpc.is_active is False
+        assert call_1.cancelled is True
 
     def test_send_recover(self):
         error = ValueError()
@@ -441,6 +519,26 @@
         assert bidi_rpc.pending_requests == 1
         assert bidi_rpc._request_queue.get() is None
 
+    def test_recv_terminate(self):
+        cancellation = ValueError()
+        call = CallStub([cancellation])
+        start_rpc = mock.create_autospec(
+            grpc.StreamStreamMultiCallable, instance=True, return_value=call
+        )
+        should_recover = mock.Mock(spec=["__call__"], return_value=False)
+        should_terminate = mock.Mock(spec=["__call__"], return_value=True)
+        bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, 
should_terminate=should_terminate)
+
+        bidi_rpc.open()
+
+        bidi_rpc.recv()
+
+        should_recover.assert_not_called()
+        should_terminate.assert_called_once_with(cancellation)
+        assert bidi_rpc.call == call
+        assert bidi_rpc.is_active is False
+        assert call.cancelled is True
+
     def test_recv_recover(self):
         error = ValueError()
         call_1 = CallStub([1, error])


Reply via email to