Skip to content
Permalink
Browse files
Revert "test: unskip list_backup_operations sample test (#170)" (#174)
This reverts commit 864f09c.
  • Loading branch information
larkee committed Nov 24, 2020
1 parent d59d502 commit 6053f4ab0fc647a9cfc181e16c246141483c2397
Showing with 8 additions and 17 deletions.
  1. +2 −17 google/cloud/spanner_v1/instance.py
  2. +6 −0 samples/samples/backup_sample_test.py
@@ -14,7 +14,6 @@

"""User friendly container for Cloud Spanner Instance."""

import google.api_core.operation
import re

from google.cloud.spanner_admin_instance_v1 import Instance as InstancePB
@@ -466,7 +465,7 @@ def list_backup_operations(self, filter_="", page_size=None):
page_iter = self._client.database_admin_api.list_backup_operations(
request=request, metadata=metadata
)
return map(self._item_to_operation, page_iter)
return page_iter

def list_database_operations(self, filter_="", page_size=None):
"""List database operations for the instance.
@@ -494,18 +493,4 @@ def list_database_operations(self, filter_="", page_size=None):
page_iter = self._client.database_admin_api.list_database_operations(
request=request, metadata=metadata
)
return map(self._item_to_operation, page_iter)

def _item_to_operation(self, operation_pb):
"""Convert an operation protobuf to the native object.
:type operation_pb: :class:`~google.longrunning.operations.Operation`
:param operation_pb: An operation returned from the API.
:rtype: :class:`~google.api_core.operation.Operation`
:returns: The next operation in the page.
"""
operations_client = self._client.database_admin_api.transport.operations_client
metadata_type = _type_string_to_type_pb(operation_pb.metadata.type_url)
response_type = _OPERATION_RESPONSE_TYPES[metadata_type]
return google.api_core.operation.from_gapic(
operation_pb, operations_client, response_type, metadata_type=metadata_type
)
return page_iter
@@ -79,6 +79,12 @@ def test_restore_database(capsys):
assert BACKUP_ID in out


@pytest.mark.skip(
reason=(
"failing due to a production bug"
"https://github.com/googleapis/python-spanner/issues/149"
)
)
def test_list_backup_operations(capsys, spanner_instance):
backup_sample.list_backup_operations(INSTANCE_ID, DATABASE_ID)
out, _ = capsys.readouterr()

0 comments on commit 6053f4a

Please sign in to comment.