@@ -82,9 +82,9 @@ def test_ctor(self):
8282 creds = _Credentials ()
8383 http = object ()
8484 client = self ._make_one (credentials = creds , http = http )
85- self .assertIsInstance (client .connection , Connection )
86- self .assertTrue (client .connection .credentials is creds )
87- self .assertTrue (client .connection .http is http )
85+ self .assertIsInstance (client ._connection , Connection )
86+ self .assertTrue (client ._connection .credentials is creds )
87+ self .assertTrue (client ._connection .http is http )
8888
8989 def test_ctor_use_gax_preset (self ):
9090 creds = _Credentials ()
@@ -147,7 +147,7 @@ def test_sync_recognize_content_with_optional_params_no_gax(self):
147147 }
148148 credentials = _Credentials ()
149149 client = self ._make_one (credentials = credentials , use_gax = False )
150- client .connection = _Connection (RETURNED )
150+ client ._connection = _Connection (RETURNED )
151151
152152 encoding = speech .Encoding .FLAC
153153
@@ -160,8 +160,8 @@ def test_sync_recognize_content_with_optional_params_no_gax(self):
160160 profanity_filter = True ,
161161 speech_context = self .HINTS )
162162
163- self .assertEqual (len (client .connection ._requested ), 1 )
164- req = client .connection ._requested [0 ]
163+ self .assertEqual (len (client ._connection ._requested ), 1 )
164+ req = client ._connection ._requested [0 ]
165165 self .assertEqual (len (req ), 3 )
166166 self .assertEqual (req ['data' ], REQUEST )
167167 self .assertEqual (req ['method' ], 'POST' )
@@ -192,7 +192,7 @@ def test_sync_recognize_source_uri_without_optional_params_no_gax(self):
192192 }
193193 credentials = _Credentials ()
194194 client = self ._make_one (credentials = credentials , use_gax = False )
195- client .connection = _Connection (RETURNED )
195+ client ._connection = _Connection (RETURNED )
196196
197197 encoding = speech .Encoding .FLAC
198198
@@ -201,8 +201,8 @@ def test_sync_recognize_source_uri_without_optional_params_no_gax(self):
201201
202202 response = client .sync_recognize (sample )
203203
204- self .assertEqual (len (client .connection ._requested ), 1 )
205- req = client .connection ._requested [0 ]
204+ self .assertEqual (len (client ._connection ._requested ), 1 )
205+ req = client ._connection ._requested [0 ]
206206 self .assertEqual (len (req ), 3 )
207207 self .assertEqual (req ['data' ], REQUEST )
208208 self .assertEqual (req ['method' ], 'POST' )
@@ -222,7 +222,7 @@ def test_sync_recognize_with_empty_results_no_gax(self):
222222
223223 credentials = _Credentials ()
224224 client = self ._make_one (credentials = credentials , use_gax = False )
225- client .connection = _Connection (SYNC_RECOGNIZE_EMPTY_RESPONSE )
225+ client ._connection = _Connection (SYNC_RECOGNIZE_EMPTY_RESPONSE )
226226
227227 sample = Sample (source_uri = self .AUDIO_SOURCE_URI ,
228228 encoding = speech .Encoding .FLAC ,
@@ -240,8 +240,8 @@ def test_sync_recognize_with_empty_results_gax(self):
240240
241241 credentials = _Credentials ()
242242 client = self ._make_one (credentials = credentials , use_gax = True )
243- client .connection = _Connection ()
244- client .connection .credentials = credentials
243+ client ._connection = _Connection ()
244+ client ._connection .credentials = credentials
245245
246246 channel_args = []
247247 channel_obj = object ()
@@ -283,8 +283,8 @@ def test_sync_recognize_with_gax(self):
283283
284284 creds = _Credentials ()
285285 client = self ._make_one (credentials = creds , use_gax = True )
286- client .connection = _Connection ()
287- client .connection .credentials = creds
286+ client ._connection = _Connection ()
287+ client ._connection .credentials = creds
288288 client ._speech_api = None
289289
290290 alternatives = [{
@@ -344,7 +344,7 @@ def test_async_supported_encodings(self):
344344
345345 credentials = _Credentials ()
346346 client = self ._make_one (credentials = credentials )
347- client .connection = _Connection ({})
347+ client ._connection = _Connection ({})
348348
349349 sample = Sample (source_uri = self .AUDIO_SOURCE_URI ,
350350 encoding = speech .Encoding .FLAC ,
@@ -362,7 +362,7 @@ def test_async_recognize_no_gax(self):
362362
363363 credentials = _Credentials ()
364364 client = self ._make_one (credentials = credentials , use_gax = False )
365- client .connection = _Connection (RETURNED )
365+ client ._connection = _Connection (RETURNED )
366366
367367 sample = Sample (source_uri = self .AUDIO_SOURCE_URI ,
368368 encoding = speech .Encoding .LINEAR16 ,
@@ -385,8 +385,8 @@ def test_async_recognize_with_gax(self):
385385 credentials = _Credentials ()
386386 client = self ._make_one (credentials = credentials ,
387387 use_gax = True )
388- client .connection = _Connection ()
389- client .connection .credentials = credentials
388+ client ._connection = _Connection ()
389+ client ._connection .credentials = credentials
390390
391391 channel_args = []
392392 channel_obj = object ()
@@ -652,8 +652,8 @@ def test_speech_api_with_gax(self):
652652
653653 creds = _Credentials ()
654654 client = self ._make_one (credentials = creds , use_gax = True )
655- client .connection = _Connection ()
656- client .connection .credentials = creds
655+ client ._connection = _Connection ()
656+ client ._connection .credentials = creds
657657
658658 channel_args = []
659659 channel_obj = object ()
@@ -680,14 +680,14 @@ def speech_api(channel=None):
680680 self .assertEqual (channel_args , [expected ])
681681
682682 def test_speech_api_without_gax (self ):
683- from google .cloud .connection import Connection
683+ from google .cloud ._http import Connection
684684 from google .cloud .speech .client import _JSONSpeechAPI
685685
686686 creds = _Credentials ()
687687 client = self ._make_one (credentials = creds , use_gax = False )
688688 self .assertIsNone (client ._speech_api )
689689 self .assertIsInstance (client .speech_api , _JSONSpeechAPI )
690- self .assertIsInstance (client .speech_api .connection , Connection )
690+ self .assertIsInstance (client .speech_api ._connection , Connection )
691691
692692 def test_speech_api_preset (self ):
693693 creds = _Credentials ()
0 commit comments