Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed failed tests on Kokoro (Spanner + Translate) #1192

Merged
merged 2 commits into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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