|
20 | 20 | start_mock_server, |
21 | 21 | SpannerServicer, |
22 | 22 | ) |
23 | | -from google.cloud.spanner_v1.client import Client |
24 | 23 | import google.cloud.spanner_v1.types.type as spanner_type |
25 | 24 | import google.cloud.spanner_v1.types.result_set as result_set |
26 | 25 | from google.api_core.client_options import ClientOptions |
@@ -79,27 +78,6 @@ def unavailable_status() -> _Status: |
79 | 78 | return status |
80 | 79 |
|
81 | 80 |
|
82 | | -# Creates an UNAVAILABLE status with the smallest possible retry delay. |
83 | | -def unavailable_status() -> _Status: |
84 | | - error = status_pb2.Status( |
85 | | - code=code_pb2.UNAVAILABLE, |
86 | | - message="Service unavailable.", |
87 | | - ) |
88 | | - retry_info = RetryInfo(retry_delay=Duration(seconds=0, nanos=1)) |
89 | | - status = _Status( |
90 | | - code=code_to_grpc_status_code(error.code), |
91 | | - details=error.message, |
92 | | - trailing_metadata=( |
93 | | - ("grpc-status-details-bin", error.SerializeToString()), |
94 | | - ( |
95 | | - "google.rpc.retryinfo-bin", |
96 | | - retry_info.SerializeToString(), |
97 | | - ), |
98 | | - ), |
99 | | - ) |
100 | | - return status |
101 | | - |
102 | | - |
103 | 81 | def add_error(method: str, error: status_pb2.Status): |
104 | 82 | MockServerTestBase.spanner_service.mock_spanner.add_error(method, error) |
105 | 83 |
|
@@ -213,5 +191,4 @@ def database(self) -> Database: |
213 | 191 | pool=FixedSizePool(size=10), |
214 | 192 | enable_interceptors_in_tests=True, |
215 | 193 | ) |
216 | | - print("self._database", self._database) |
217 | 194 | return self._database |
0 commit comments