@@ -190,6 +190,7 @@ def _assert_face(self, face):
190190
191191 def test_detect_faces_content (self ):
192192 client = Config .CLIENT
193+ client ._use_gax = False
193194 with open (FACE_FILE , 'rb' ) as image_file :
194195 image = client .image (content = image_file .read ())
195196 faces = image .detect_faces ()
@@ -208,6 +209,7 @@ def test_detect_faces_gcs(self):
208209 source_uri = 'gs://%s/%s' % (bucket_name , blob_name )
209210
210211 client = Config .CLIENT
212+ client ._use_gax = False
211213 image = client .image (source_uri = source_uri )
212214 faces = image .detect_faces ()
213215 self .assertEqual (len (faces ), 5 )
@@ -216,6 +218,7 @@ def test_detect_faces_gcs(self):
216218
217219 def test_detect_faces_filename (self ):
218220 client = Config .CLIENT
221+ client ._use_gax = False
219222 image = client .image (filename = FACE_FILE )
220223 faces = image .detect_faces ()
221224 self .assertEqual (len (faces ), 5 )
@@ -310,6 +313,7 @@ def _assert_landmark(self, landmark):
310313
311314 def test_detect_landmark_content (self ):
312315 client = Config .CLIENT
316+ client ._use_gax = True
313317 with open (LANDMARK_FILE , 'rb' ) as image_file :
314318 image = client .image (content = image_file .read ())
315319 landmarks = image .detect_landmarks ()
@@ -328,6 +332,7 @@ def test_detect_landmark_gcs(self):
328332 source_uri = 'gs://%s/%s' % (bucket_name , blob_name )
329333
330334 client = Config .CLIENT
335+ client ._use_gax = True
331336 image = client .image (source_uri = source_uri )
332337 landmarks = image .detect_landmarks ()
333338 self .assertEqual (len (landmarks ), 1 )
@@ -336,6 +341,7 @@ def test_detect_landmark_gcs(self):
336341
337342 def test_detect_landmark_filename (self ):
338343 client = Config .CLIENT
344+ client ._use_gax = True
339345 image = client .image (filename = LANDMARK_FILE )
340346 landmarks = image .detect_landmarks ()
341347 self .assertEqual (len (landmarks ), 1 )
@@ -362,6 +368,7 @@ def _assert_safe_search(self, safe_search):
362368
363369 def test_detect_safe_search_content (self ):
364370 client = Config .CLIENT
371+ client ._use_gax = False
365372 with open (FACE_FILE , 'rb' ) as image_file :
366373 image = client .image (content = image_file .read ())
367374 safe_searches = image .detect_safe_search ()
@@ -380,6 +387,7 @@ def test_detect_safe_search_gcs(self):
380387 source_uri = 'gs://%s/%s' % (bucket_name , blob_name )
381388
382389 client = Config .CLIENT
390+ client ._use_gax = False
383391 image = client .image (source_uri = source_uri )
384392 safe_searches = image .detect_safe_search ()
385393 self .assertEqual (len (safe_searches ), 1 )
@@ -388,6 +396,7 @@ def test_detect_safe_search_gcs(self):
388396
389397 def test_detect_safe_search_filename (self ):
390398 client = Config .CLIENT
399+ client ._use_gax = False
391400 image = client .image (filename = FACE_FILE )
392401 safe_searches = image .detect_safe_search ()
393402 self .assertEqual (len (safe_searches ), 1 )
@@ -423,6 +432,7 @@ def _assert_text(self, text):
423432
424433 def test_detect_text_content (self ):
425434 client = Config .CLIENT
435+ client ._use_gax = True
426436 with open (TEXT_FILE , 'rb' ) as image_file :
427437 image = client .image (content = image_file .read ())
428438 texts = image .detect_text ()
@@ -441,6 +451,7 @@ def test_detect_text_gcs(self):
441451 source_uri = 'gs://%s/%s' % (bucket_name , blob_name )
442452
443453 client = Config .CLIENT
454+ client ._use_gax = True
444455 image = client .image (source_uri = source_uri )
445456 texts = image .detect_text ()
446457 self .assertEqual (len (texts ), 9 )
@@ -449,6 +460,7 @@ def test_detect_text_gcs(self):
449460
450461 def test_detect_text_filename (self ):
451462 client = Config .CLIENT
463+ client ._use_gax = True
452464 image = client .image (filename = TEXT_FILE )
453465 texts = image .detect_text ()
454466 self .assertEqual (len (texts ), 9 )
@@ -485,6 +497,7 @@ def _assert_properties(self, image_property):
485497
486498 def test_detect_properties_content (self ):
487499 client = Config .CLIENT
500+ client ._use_gax = False
488501 with open (FACE_FILE , 'rb' ) as image_file :
489502 image = client .image (content = image_file .read ())
490503 properties = image .detect_properties ()
@@ -503,6 +516,7 @@ def test_detect_properties_gcs(self):
503516 source_uri = 'gs://%s/%s' % (bucket_name , blob_name )
504517
505518 client = Config .CLIENT
519+ client ._use_gax = False
506520 image = client .image (source_uri = source_uri )
507521 properties = image .detect_properties ()
508522 self .assertEqual (len (properties ), 1 )
@@ -511,6 +525,7 @@ def test_detect_properties_gcs(self):
511525
512526 def test_detect_properties_filename (self ):
513527 client = Config .CLIENT
528+ client ._use_gax = False
514529 image = client .image (filename = FACE_FILE )
515530 properties = image .detect_properties ()
516531 self .assertEqual (len (properties ), 1 )
0 commit comments