Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 21a2fa9

Browse files
committed
test: remove deprecated options
1 parent 0874d1e commit 21a2fa9

2 files changed

Lines changed: 2 additions & 23 deletions

File tree

tests/unit/test_client.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class TestClient(unittest.TestCase):
3838
DISPLAY_NAME = "display-name"
3939
NODE_COUNT = 5
4040
TIMEOUT_SECONDS = 80
41-
USER_AGENT = "you-sir-age-int"
4241

4342
def _get_target_class(self):
4443
from google.cloud import spanner
@@ -54,7 +53,6 @@ def _constructor_test_helper(
5453
creds,
5554
expected_creds=None,
5655
client_info=None,
57-
user_agent=None,
5856
client_options=None,
5957
query_options=None,
6058
expected_query_options=None,
@@ -80,7 +78,6 @@ def _constructor_test_helper(
8078
client = self._make_one(
8179
project=self.PROJECT,
8280
credentials=creds,
83-
user_agent=user_agent,
8481
query_options=query_options,
8582
**kwargs
8683
)
@@ -94,7 +91,6 @@ def _constructor_test_helper(
9491

9592
self.assertEqual(client.project, self.PROJECT)
9693
self.assertIs(client._client_info, expected_client_info)
97-
self.assertEqual(client.user_agent, user_agent)
9894
if expected_client_options is not None:
9995
self.assertIsInstance(
10096
client._client_options, google.api_core.client_options.ClientOptions
@@ -127,20 +123,6 @@ def test_constructor_default_scopes(self):
127123
creds = _make_credentials()
128124
self._constructor_test_helper(expected_scopes, creds)
129125

130-
@mock.patch("warnings.warn")
131-
def test_constructor_custom_user_agent_and_timeout(self, mock_warn):
132-
from google.cloud.spanner_v1 import client as MUT
133-
134-
CUSTOM_USER_AGENT = "custom-application"
135-
expected_scopes = (MUT.SPANNER_ADMIN_SCOPE,)
136-
creds = _make_credentials()
137-
self._constructor_test_helper(
138-
expected_scopes, creds, user_agent=CUSTOM_USER_AGENT
139-
)
140-
mock_warn.assert_called_once_with(
141-
MUT._USER_AGENT_DEPRECATED, DeprecationWarning, stacklevel=2
142-
)
143-
144126
def test_constructor_custom_client_info(self):
145127
from google.cloud.spanner_v1 import client as MUT
146128

tests/unit/test_instance.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,7 @@ def test_list_databases_w_options(self):
540540
] = mock.Mock(return_value=databases_pb)
541541

542542
page_size = 42
543-
page_token = "token"
544-
response = instance.list_databases(page_size=page_size, page_token=page_token)
543+
response = instance.list_databases(page_size=page_size)
545544
databases = list(response)
546545

547546
self.assertEqual(databases, [])
@@ -551,9 +550,7 @@ def test_list_databases_w_options(self):
551550
("x-goog-request-params", "parent={}".format(instance.name)),
552551
)
553552
ld_api.assert_called_once_with(
554-
ListDatabasesRequest(
555-
parent=self.INSTANCE_NAME, page_size=page_size, page_token=page_token
556-
),
553+
ListDatabasesRequest(parent=self.INSTANCE_NAME, page_size=page_size),
557554
metadata=expected_metadata,
558555
retry=mock.ANY,
559556
timeout=mock.ANY,

0 commit comments

Comments
 (0)