diff --git a/system_tests/vision.py b/system_tests/vision.py index 62fae6de14ea..6035eb5588d5 100644 --- a/system_tests/vision.py +++ b/system_tests/vision.py @@ -498,7 +498,7 @@ def _assert_properties(self, image_property): def test_detect_properties_content(self): self._pb_not_implemented_skip( - 'gRPC not implemented for text detection.') + 'gRPC not implemented for image properties detection.') client = Config.CLIENT with open(FACE_FILE, 'rb') as image_file: image = client.image(content=image_file.read()) @@ -509,7 +509,7 @@ def test_detect_properties_content(self): def test_detect_properties_gcs(self): self._pb_not_implemented_skip( - 'gRPC not implemented for text detection.') + 'gRPC not implemented for image properties detection.') client = Config.CLIENT bucket_name = Config.TEST_BUCKET.name blob_name = 'faces.jpg' @@ -528,7 +528,7 @@ def test_detect_properties_gcs(self): def test_detect_properties_filename(self): self._pb_not_implemented_skip( - 'gRPC not implemented for text detection.') + 'gRPC not implemented for image properties detection.') client = Config.CLIENT image = client.image(filename=FACE_FILE) properties = image.detect_properties() diff --git a/vision/unit_tests/test_client.py b/vision/unit_tests/test_client.py index 0f64ae5c8a62..6191d19571a0 100644 --- a/vision/unit_tests/test_client.py +++ b/vision/unit_tests/test_client.py @@ -97,7 +97,8 @@ def test_face_annotation(self): ] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) features = [Feature(feature_type=FeatureTypes.FACE_DETECTION, @@ -123,8 +124,8 @@ def test_image_with_client_raw_content(self): from google.cloud.vision.image import Image credentials = _make_credentials() - client = self._make_one(project=PROJECT, - credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) raw_image = client.image(content=IMAGE_CONTENT) self.assertIsInstance(raw_image, Image) self.assertEqual(raw_image.content, IMAGE_CONTENT) @@ -135,8 +136,8 @@ def test_image_with_client_filename(self): from google.cloud.vision.image import Image credentials = _make_credentials() - client = self._make_one(project=PROJECT, - credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) with patch('google.cloud.vision.image.open', mock_open(read_data=IMAGE_CONTENT)) as m: file_image = client.image(filename='my_image.jpg') @@ -156,7 +157,8 @@ def test_multiple_detection_from_content(self): returned['responses'][0]['logoAnnotations'] = logos['logoAnnotations'] credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(returned) limit = 2 @@ -203,7 +205,8 @@ def test_face_detection_from_source(self): from unit_tests._fixtures import FACE_DETECTION_RESPONSE RETURNED = FACE_DETECTION_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -220,7 +223,8 @@ def test_face_detection_from_content(self): from unit_tests._fixtures import FACE_DETECTION_RESPONSE RETURNED = FACE_DETECTION_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -238,7 +242,8 @@ def test_face_detection_from_content_no_results(self): 'responses': [{}] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -257,7 +262,8 @@ def test_label_detection_from_source(self): LABEL_DETECTION_RESPONSE as RETURNED) credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -278,7 +284,8 @@ def test_label_detection_no_results(self): 'responses': [{}] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -292,7 +299,8 @@ def test_landmark_detection_from_source(self): LANDMARK_DETECTION_RESPONSE as RETURNED) credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -314,7 +322,8 @@ def test_landmark_detection_from_content(self): LANDMARK_DETECTION_RESPONSE as RETURNED) credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -331,7 +340,8 @@ def test_landmark_detection_no_results(self): 'responses': [{}] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -344,7 +354,8 @@ def test_logo_detection_from_source(self): from unit_tests._fixtures import LOGO_DETECTION_RESPONSE RETURNED = LOGO_DETECTION_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -361,7 +372,8 @@ def test_logo_detection_from_content(self): from unit_tests._fixtures import LOGO_DETECTION_RESPONSE RETURNED = LOGO_DETECTION_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -379,7 +391,8 @@ def test_text_detection_from_source(self): TEXT_DETECTION_RESPONSE as RETURNED) credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -402,7 +415,8 @@ def test_safe_search_detection_from_source(self): RETURNED = SAFE_SEARCH_DETECTION_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -421,7 +435,8 @@ def test_safe_search_no_results(self): 'responses': [{}] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT) @@ -435,7 +450,8 @@ def test_image_properties_detection_from_source(self): RETURNED = IMAGE_PROPERTIES_RESPONSE credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(source_uri=IMAGE_SOURCE) @@ -457,7 +473,8 @@ def test_image_properties_no_results(self): 'responses': [{}] } credentials = _make_credentials() - client = self._make_one(project=PROJECT, credentials=credentials) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=False) client._connection = _Connection(RETURNED) image = client.image(content=IMAGE_CONTENT)