Skip to content

Commit

Permalink
Mo mocking.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Jan 3, 2017
1 parent ba05fca commit 88404ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vision/unit_tests/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

This comment has been minimized.

Copy link
@dhermes

dhermes Jan 3, 2017

Contributor

Why this change in this commit?

This comment has been minimized.

Copy link
@daspecster

daspecster Jan 4, 2017

Author Contributor

Having it as bytes was causing the py3 tests to fail.

client = object()
image = Image(client, source_uri=image_uri)
image_pb = self._call_fut(image)
Expand Down
9 changes: 5 additions & 4 deletions vision/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88404ac

Please sign in to comment.