From dae800f770a323c2c6ceb775a5bce058006b6bf6 Mon Sep 17 00:00:00 2001 From: michaelawyu Date: Fri, 3 Nov 2017 12:48:24 -0700 Subject: [PATCH] Fixed failed tests on Kokoro (Spanner + Translate) [(#1192)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1192) * Fixed failed tests on Kokoro (Spanner + Translate) * Update quickstart_test.py --- samples/samples/quickstart_test.py | 6 ++---- samples/samples/snippets.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/samples/quickstart_test.py b/samples/samples/quickstart_test.py index c2e42001b8..de20872503 100644 --- a/samples/samples/quickstart_test.py +++ b/samples/samples/quickstart_test.py @@ -15,8 +15,6 @@ import os from google.cloud import spanner -import google.cloud.exceptions -import google.cloud.spanner.client import mock import pytest @@ -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) diff --git a/samples/samples/snippets.py b/samples/samples/snippets.py index 61e5aff595..380254ffad 100644 --- a/samples/samples/snippets.py +++ b/samples/samples/snippets.py @@ -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)