Skip to content

Commit 73e722b

Browse files
committed
fix async tests
1 parent ab8cc79 commit 73e722b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/unit/operations_v1/test_operations_rest_client.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,19 @@ def test_operations_client_client_options_credentials_file(
543543
with pytest.warns(DeprecationWarning):
544544
options = client_options.ClientOptions(credentials_file="credentials.json")
545545
if "async" in str(client_class):
546-
# TODO(): Add support for credentials file to async REST transport.
547-
with pytest.raises(core_exceptions.AsyncRestUnsupportedParameterError):
548-
client_class(client_options=options, transport=transport_name)
546+
with mock.patch.object(transport_class, "__init__") as patched:
547+
patched.return_value = None
548+
client = client_class(client_options=options, transport=transport_name)
549+
patched.assert_called_once_with(
550+
credentials=None,
551+
credentials_file="credentials.json",
552+
host=client.DEFAULT_ENDPOINT,
553+
scopes=None,
554+
client_cert_source_for_mtls=None,
555+
quota_project_id=None,
556+
client_info=transports.base.DEFAULT_CLIENT_INFO,
557+
always_use_jwt_access=True,
558+
)
549559
else:
550560
with mock.patch.object(transport_class, "__init__") as patched:
551561
patched.return_value = None

0 commit comments

Comments
 (0)