Skip to content

Commit f0cb4d7

Browse files
committed
Fix travis credentials.
1 parent 6b949c7 commit f0cb4d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

speech/unit_tests/test_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,24 @@ def speech_api():
338338
self.assertIsNone(operation.response)
339339

340340
def test_speech_api_with_gax(self):
341+
from google.cloud._testing import _Monkey
342+
343+
from google.cloud.speech import _gax
341344
from google.cloud.speech.client import GAPICSpeechAPI
342345

343346
creds = _Credentials()
344347
client = self._makeOne(credentials=creds, use_gax=True)
345348
client.connection = _Connection()
346349
client.connection.credentials = creds
347350

351+
def speech_api():
352+
return _MockGAPICSpeechAPI()
353+
348354
self.assertIsNone(client._speech_api)
355+
356+
with _Monkey(_gax, SpeechApi=speech_api):
357+
client._speech_api = _gax.GAPICSpeechAPI(client)
358+
349359
self.assertIsInstance(client.speech_api, GAPICSpeechAPI)
350360

351361
def test_speech_api_without_gax(self):

0 commit comments

Comments
 (0)