File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -338,14 +338,24 @@ def speech_api():
338
338
self .assertIsNone (operation .response )
339
339
340
340
def test_speech_api_with_gax (self ):
341
+ from google .cloud ._testing import _Monkey
342
+
343
+ from google .cloud .speech import _gax
341
344
from google .cloud .speech .client import GAPICSpeechAPI
342
345
343
346
creds = _Credentials ()
344
347
client = self ._makeOne (credentials = creds , use_gax = True )
345
348
client .connection = _Connection ()
346
349
client .connection .credentials = creds
347
350
351
+ def speech_api ():
352
+ return _MockGAPICSpeechAPI ()
353
+
348
354
self .assertIsNone (client ._speech_api )
355
+
356
+ with _Monkey (_gax , SpeechApi = speech_api ):
357
+ client ._speech_api = _gax .GAPICSpeechAPI (client )
358
+
349
359
self .assertIsInstance (client .speech_api , GAPICSpeechAPI )
350
360
351
361
def test_speech_api_without_gax (self ):
You can’t perform that action at this time.
0 commit comments