8000 test: fix credential scope assertions (#223) · larkee/python-spanner@05c3ad9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 05c3ad9

Browse files
authored
test: fix credential scope assertions (googleapis#223)
The assertions for credential scope in the `client` unit tests were broken by [a PR in the auth library](googleapis/google-auth-library-python#665). This does raise the question of whether we should be asserting the scopes like this in this library. This PR fixes the assertions. Removal of these assertions can be done in a separate PR if it is decided they don't belong in this library.
1 parent d790cfb commit 05c3ad9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/unit/test_client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def _constructor_test_helper(
8888

8989
self.assertIs(client._credentials, expected_creds)
9090
if expected_scopes is not None:
91-
creds.with_scopes.assert_called_once_with(expected_scopes)
91+
creds.with_scopes.assert_called_once_with(
92+
expected_scopes, default_scopes=None
93+
)
9294

9395
self.assertEqual(client.project, self.PROJECT)
9496
self.assertIs(client._client_info, expected_client_info)
@@ -235,7 +237,9 @@ def test_instance_admin_api(self, mock_em):
235237
credentials=mock.ANY, client_info=client_info, client_options=client_options
236238
)
237239

238-
credentials.with_scopes.assert_called_once_with(expected_scopes)
240+
credentials.with_scopes.assert_called_once_with(
241+
expected_scopes, default_scopes=None
242+
)
239243

240244
@mock.patch("google.cloud.spanner_v1.client._get_spanner_emulator_host")
241245
def test_instance_admin_api_emulator_env(self, mock_em):
@@ -333,7 +337,9 @@ def test_database_admin_api(self, mock_em):
333337
credentials=mock.ANY, client_info=client_info, client_options=client_options
334338
)
335339

336-
credentials.with_scopes.assert_called_once_with(expected_scopes)
340+
credentials.with_scopes.assert_called_once_with(
341+
expected_scopes, default_scopes=None
342+
)
337343

338344
@mock.patch("google.cloud.spanner_v1.client._get_spanner_emulator_host")
339345
def test_database_admin_api_emulator_env(self, mock_em):

0 commit comments

Comments
 (0)
0