@@ -97,7 +97,8 @@ def test_face_annotation(self):
97
97
]
98
98
}
99
99
credentials = _make_credentials ()
100
- client = self ._make_one (project = PROJECT , credentials = credentials )
100
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
101
+ use_gax = False )
101
102
client ._connection = _Connection (RETURNED )
102
103
103
104
features = [Feature (feature_type = FeatureTypes .FACE_DETECTION ,
@@ -123,8 +124,8 @@ def test_image_with_client_raw_content(self):
123
124
from google .cloud .vision .image import Image
124
125
125
126
credentials = _make_credentials ()
126
- client = self ._make_one (project = PROJECT ,
127
- credentials = credentials )
127
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
128
+ use_gax = False )
128
129
raw_image = client .image (content = IMAGE_CONTENT )
129
130
self .assertIsInstance (raw_image , Image )
130
131
self .assertEqual (raw_image .content , IMAGE_CONTENT )
@@ -135,8 +136,8 @@ def test_image_with_client_filename(self):
135
136
from google .cloud .vision .image import Image
136
137
137
138
credentials = _make_credentials ()
138
- client = self ._make_one (project = PROJECT ,
139
- credentials = credentials )
139
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
140
+ use_gax = False )
140
141
with patch ('google.cloud.vision.image.open' ,
141
142
mock_open (read_data = IMAGE_CONTENT )) as m :
142
143
file_image = client .image (filename = 'my_image.jpg' )
@@ -156,7 +157,8 @@ def test_multiple_detection_from_content(self):
156
157
returned ['responses' ][0 ]['logoAnnotations' ] = logos ['logoAnnotations' ]
157
158
158
159
credentials = _make_credentials ()
159
- client = self ._make_one (project = PROJECT , credentials = credentials )
160
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
161
+ use_gax = False )
160
162
client ._connection = _Connection (returned )
161
163
162
164
limit = 2
@@ -203,7 +205,8 @@ def test_face_detection_from_source(self):
203
205
from unit_tests ._fixtures import FACE_DETECTION_RESPONSE
204
206
RETURNED = FACE_DETECTION_RESPONSE
205
207
credentials = _make_credentials ()
206
- client = self ._make_one (project = PROJECT , credentials = credentials )
208
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
209
+ use_gax = False )
207
210
client ._connection = _Connection (RETURNED )
208
211
209
212
image = client .image (source_uri = IMAGE_SOURCE )
@@ -220,7 +223,8 @@ def test_face_detection_from_content(self):
220
223
from unit_tests ._fixtures import FACE_DETECTION_RESPONSE
221
224
RETURNED = FACE_DETECTION_RESPONSE
222
225
credentials = _make_credentials ()
223
- client = self ._make_one (project = PROJECT , credentials = credentials )
226
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
227
+ use_gax = False )
224
228
client ._connection = _Connection (RETURNED )
225
229
226
230
image = client .image (content = IMAGE_CONTENT )
@@ -238,7 +242,8 @@ def test_face_detection_from_content_no_results(self):
238
242
'responses' : [{}]
239
243
}
240
244
credentials = _make_credentials ()
241
- client = self ._make_one (project = PROJECT , credentials = credentials )
245
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
246
+ use_gax = False )
242
247
client ._connection = _Connection (RETURNED )
243
248
244
249
image = client .image (content = IMAGE_CONTENT )
@@ -257,7 +262,8 @@ def test_label_detection_from_source(self):
257
262
LABEL_DETECTION_RESPONSE as RETURNED )
258
263
259
264
credentials = _make_credentials ()
260
- client = self ._make_one (project = PROJECT , credentials = credentials )
265
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
266
+ use_gax = False )
261
267
client ._connection = _Connection (RETURNED )
262
268
263
269
image = client .image (source_uri = IMAGE_SOURCE )
@@ -278,7 +284,8 @@ def test_label_detection_no_results(self):
278
284
'responses' : [{}]
279
285
}
280
286
credentials = _make_credentials ()
281
- client = self ._make_one (project = PROJECT , credentials = credentials )
287
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
288
+ use_gax = False )
282
289
client ._connection = _Connection (RETURNED )
283
290
284
291
image = client .image (content = IMAGE_CONTENT )
@@ -292,7 +299,8 @@ def test_landmark_detection_from_source(self):
292
299
LANDMARK_DETECTION_RESPONSE as RETURNED )
293
300
294
301
credentials = _make_credentials ()
295
- client = self ._make_one (project = PROJECT , credentials = credentials )
302
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
303
+ use_gax = False )
296
304
client ._connection = _Connection (RETURNED )
297
305
298
306
image = client .image (source_uri = IMAGE_SOURCE )
@@ -314,7 +322,8 @@ def test_landmark_detection_from_content(self):
314
322
LANDMARK_DETECTION_RESPONSE as RETURNED )
315
323
316
324
credentials = _make_credentials ()
317
- client = self ._make_one (project = PROJECT , credentials = credentials )
325
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
326
+ use_gax = False )
318
327
client ._connection = _Connection (RETURNED )
319
328
320
329
image = client .image (content = IMAGE_CONTENT )
@@ -331,7 +340,8 @@ def test_landmark_detection_no_results(self):
331
340
'responses' : [{}]
332
341
}
333
342
credentials = _make_credentials ()
334
- client = self ._make_one (project = PROJECT , credentials = credentials )
343
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
344
+ use_gax = False )
335
345
client ._connection = _Connection (RETURNED )
336
346
337
347
image = client .image (content = IMAGE_CONTENT )
@@ -344,7 +354,8 @@ def test_logo_detection_from_source(self):
344
354
from unit_tests ._fixtures import LOGO_DETECTION_RESPONSE
345
355
RETURNED = LOGO_DETECTION_RESPONSE
346
356
credentials = _make_credentials ()
347
- client = self ._make_one (project = PROJECT , credentials = credentials )
357
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
358
+ use_gax = False )
348
359
client ._connection = _Connection (RETURNED )
349
360
350
361
image = client .image (source_uri = IMAGE_SOURCE )
@@ -361,7 +372,8 @@ def test_logo_detection_from_content(self):
361
372
from unit_tests ._fixtures import LOGO_DETECTION_RESPONSE
362
373
RETURNED = LOGO_DETECTION_RESPONSE
363
374
credentials = _make_credentials ()
364
- client = self ._make_one (project = PROJECT , credentials = credentials )
375
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
376
+ use_gax = False )
365
377
client ._connection = _Connection (RETURNED )
366
378
367
379
image = client .image (content = IMAGE_CONTENT )
@@ -379,7 +391,8 @@ def test_text_detection_from_source(self):
379
391
TEXT_DETECTION_RESPONSE as RETURNED )
380
392
381
393
credentials = _make_credentials ()
382
- client = self ._make_one (project = PROJECT , credentials = credentials )
394
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
395
+ use_gax = False )
383
396
client ._connection = _Connection (RETURNED )
384
397
385
398
image = client .image (source_uri = IMAGE_SOURCE )
@@ -402,7 +415,8 @@ def test_safe_search_detection_from_source(self):
402
415
403
416
RETURNED = SAFE_SEARCH_DETECTION_RESPONSE
404
417
credentials = _make_credentials ()
405
- client = self ._make_one (project = PROJECT , credentials = credentials )
418
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
419
+ use_gax = False )
406
420
client ._connection = _Connection (RETURNED )
407
421
408
422
image = client .image (source_uri = IMAGE_SOURCE )
@@ -421,7 +435,8 @@ def test_safe_search_no_results(self):
421
435
'responses' : [{}]
422
436
}
423
437
credentials = _make_credentials ()
424
- client = self ._make_one (project = PROJECT , credentials = credentials )
438
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
439
+ use_gax = False )
425
440
client ._connection = _Connection (RETURNED )
426
441
427
442
image = client .image (content = IMAGE_CONTENT )
@@ -435,7 +450,8 @@ def test_image_properties_detection_from_source(self):
435
450
436
451
RETURNED = IMAGE_PROPERTIES_RESPONSE
437
452
credentials = _make_credentials ()
438
- client = self ._make_one (project = PROJECT , credentials = credentials )
453
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
454
+ use_gax = False )
439
455
client ._connection = _Connection (RETURNED )
440
456
441
457
image = client .image (source_uri = IMAGE_SOURCE )
@@ -457,7 +473,8 @@ def test_image_properties_no_results(self):
457
473
'responses' : [{}]
458
474
}
459
475
credentials = _make_credentials ()
460
- client = self ._make_one (project = PROJECT , credentials = credentials )
476
+ client = self ._make_one (project = PROJECT , credentials = credentials ,
477
+ use_gax = False )
461
478
client ._connection = _Connection (RETURNED )
462
479
463
480
image = client .image (content = IMAGE_CONTENT )
0 commit comments