From 88404ac1de2ee0fd508b851810d1491222bd1afc Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Tue, 3 Jan 2017 17:55:04 -0500 Subject: [PATCH] Mo mocking. --- vision/unit_tests/test__gax.py | 2 +- vision/unit_tests/test_client.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vision/unit_tests/test__gax.py b/vision/unit_tests/test__gax.py index cf1172661f637..8875928443956 100644 --- a/vision/unit_tests/test__gax.py +++ b/vision/unit_tests/test__gax.py @@ -72,7 +72,7 @@ def test__to_gapic_image_uri(self): from google.cloud.vision.image import Image from google.cloud.grpc.vision.v1 import image_annotator_pb2 - image_uri = b'gs://1234/34.jpg' + image_uri = 'gs://1234/34.jpg' client = object() image = Image(client, source_uri=image_uri) image_pb = self._call_fut(image) diff --git a/vision/unit_tests/test_client.py b/vision/unit_tests/test_client.py index a0d3f101c3f1c..44f76e944012d 100644 --- a/vision/unit_tests/test_client.py +++ b/vision/unit_tests/test_client.py @@ -59,11 +59,12 @@ def test_make_gax_client(self): from google.cloud.vision._gax import _GAPICVisionAPI credentials = _make_credentials() - with mock.patch('google.cloud.vision.client._GAPICVisionAPI'): - client = self._make_one(project=PROJECT, credentials=credentials, - use_gax=None) + client = self._make_one(project=PROJECT, credentials=credentials, + use_gax=None) client._connection = _Connection() - self.assertIsInstance(client._vision_api, _GAPICVisionAPI) + with mock.patch('google.cloud.vision.client._GAPICVisionAPI', + spec=True): + self.assertIsInstance(client._vision_api, _GAPICVisionAPI) def test_make_http_client(self): from google.cloud.vision._http import _HTTPVisionAPI