File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
packages/google-cloud-python-speech Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,15 @@ def __init__(self, client):
230230 self ._client = client
231231 self ._connection = client .connection
232232
233+ @property
234+ def connection (self ):
235+ """Connection property.
236+
237+ :rtype: :class:`~google.cloud.core.connection.Connection`
238+ :returns: Instance of ``Connection``
239+ """
240+ return self ._connection
241+
233242 def async_recognize (self , sample , language_code = None ,
234243 max_alternatives = None , profanity_filter = None ,
235244 speech_context = None ):
Original file line number Diff line number Diff line change @@ -294,12 +294,14 @@ def test_speech_api_with_gax(self):
294294 self .assertIsInstance (client .speech_api , GAPICSpeechAPI )
295295
296296 def test_speech_api_without_gax (self ):
297+ from google .cloud .connection import Connection
297298 from google .cloud .speech .client import _JSONSpeechAPI
298299
299300 creds = _Credentials ()
300301 client = self ._makeOne (credentials = creds , use_gax = False )
301302 self .assertIsNone (client ._speech_api )
302303 self .assertIsInstance (client .speech_api , _JSONSpeechAPI )
304+ self .assertIsInstance (client .speech_api .connection , Connection )
303305
304306 def test_speech_api_preset (self ):
305307 creds = _Credentials ()
You can’t perform that action at this time.
0 commit comments