Skip to content

Commit

Permalink
Fixed failed tests on Kokoro (Spanner + Translate) (#1192)
Browse files Browse the repository at this point in the history
* Fixed failed tests on Kokoro (Spanner + Translate)

* Update quickstart_test.py
  • Loading branch information
michaelawyu authored and Jon Wayne Parrott committed Nov 3, 2017
1 parent ea085c9 commit eb22abb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions spanner/cloud-client/quickstart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import os

from google.cloud import spanner
import google.cloud.exceptions
import google.cloud.spanner.client
import mock
import pytest

Expand All @@ -27,13 +25,13 @@

@pytest.fixture
def patch_instance():
original_instance = google.cloud.spanner.client.Client.instance
original_instance = spanner.Client.instance

def new_instance(self, unused_instance_name):
return original_instance(self, SPANNER_INSTANCE)

instance_patch = mock.patch(
'google.cloud.spanner.client.Client.instance',
'google.cloud.spanner.Client.instance',
side_effect=new_instance,
autospec=True)

Expand Down
2 changes: 1 addition & 1 deletion spanner/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def query_data_with_index(
ALTER TABLE Albums ADD COLUMN MarketingBudget INT64
"""
from google.cloud.proto.spanner.v1 import type_pb2
from google.cloud.spanner_v1.proto import type_pb2

spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)
Expand Down
2 changes: 1 addition & 1 deletion translate/cloud-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ def test_translate_utf8(capsys):
text = u'나는 파인애플을 좋아한다.'
snippets.translate_text('en', text)
out, _ = capsys.readouterr()
assert u'I like pineapple.' in out
assert u'I like pineapples.' in out

0 comments on commit eb22abb

Please sign in to comment.