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

Commit b682d29

Browse files
committed
add replacements to owlbot.py
1 parent ed09516 commit b682d29

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

owlbot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ def get_staging_dirs(
169169
)""",
170170
)
171171

172+
assert 12 == s.replace(
173+
library / "tests/unit/gapic/spanner_v1/test_spanner.py",
174+
"""api_audience=None,\n(\s+)\)""",
175+
"""api_audience=None,
176+
metrics_interceptor=mock.ANY,
177+
)"""
178+
)
172179

173180
s.move(
174181
library,

tests/unit/gapic/spanner_v1/test_spanner.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ def test_spanner_client_client_options(client_class, transport_class, transport_
485485
client_info=transports.base.DEFAULT_CLIENT_INFO,
486486
always_use_jwt_access=True,
487487
api_audience=None,
488+
metrics_interceptor=mock.ANY,
488489
)
489490

490491
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -505,6 +506,7 @@ def test_spanner_client_client_options(client_class, transport_class, transport_
505506
client_info=transports.base.DEFAULT_CLIENT_INFO,
506507
always_use_jwt_access=True,
507508
api_audience=None,
509+
metrics_interceptor=mock.ANY,
508510
)
509511

510512
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -523,6 +525,7 @@ def test_spanner_client_client_options(client_class, transport_class, transport_
523525
client_info=transports.base.DEFAULT_CLIENT_INFO,
524526
always_use_jwt_access=True,
525527
api_audience=None,
528+
metrics_interceptor=mock.ANY,
526529
)
527530

528531
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has
@@ -563,6 +566,7 @@ def test_spanner_client_client_options(client_class, transport_class, transport_
563566
client_info=transports.base.DEFAULT_CLIENT_INFO,
564567
always_use_jwt_access=True,
565568
api_audience=None,
569+
metrics_interceptor=mock.ANY,
566570
)
567571
# Check the case api_endpoint is provided
568572
options = client_options.ClientOptions(
@@ -655,6 +659,7 @@ def test_spanner_client_mtls_env_auto(
655659
client_info=transports.base.DEFAULT_CLIENT_INFO,
656660
always_use_jwt_access=True,
657661
api_audience=None,
662+
metrics_interceptor=mock.ANY,
658663
)
659664

660665
# Check the case ADC client cert is provided. Whether client cert is used depends on
@@ -692,6 +697,7 @@ def test_spanner_client_mtls_env_auto(
692697
client_info=transports.base.DEFAULT_CLIENT_INFO,
693698
always_use_jwt_access=True,
694699
api_audience=None,
700+
metrics_interceptor=mock.ANY,
695701
)
696702

697703
# Check the case client_cert_source and ADC client cert are not provided.
@@ -717,6 +723,7 @@ def test_spanner_client_mtls_env_auto(
717723
client_info=transports.base.DEFAULT_CLIENT_INFO,
718724
always_use_jwt_access=True,
719725
api_audience=None,
726+
metrics_interceptor=mock.ANY,
720727
)
721728

722729

@@ -932,6 +939,7 @@ def test_spanner_client_client_options_scopes(
932939
client_info=transports.base.DEFAULT_CLIENT_INFO,
933940
always_use_jwt_access=True,
934941
api_audience=None,
942+
metrics_interceptor=mock.ANY,
935943
)
936944

937945

@@ -969,6 +977,7 @@ def test_spanner_client_client_options_credentials_file(
969977
client_info=transports.base.DEFAULT_CLIENT_INFO,
970978
always_use_jwt_access=True,
971979
api_audience=None,
980+
metrics_interceptor=mock.ANY,
972981
)
973982

974983

@@ -988,6 +997,7 @@ def test_spanner_client_client_options_from_dict():
988997
client_info=transports.base.DEFAULT_CLIENT_INFO,
989998
always_use_jwt_access=True,
990999
api_audience=None,
1000+
metrics_interceptor=mock.ANY,
9911001
)
9921002

9931003

@@ -1024,6 +1034,7 @@ def test_spanner_client_create_channel_credentials_file(
10241034
client_info=transports.base.DEFAULT_CLIENT_INFO,
10251035
always_use_jwt_access=True,
10261036
api_audience=None,
1037+
metrics_interceptor=mock.ANY,
10271038
)
10281039

10291040
# test that the credentials from file are saved and used as the credentials.
@@ -12721,4 +12732,5 @@ def test_api_key_credentials(client_class, transport_class):
1272112732
client_info=transports.base.DEFAULT_CLIENT_INFO,
1272212733
always_use_jwt_access=True,
1272312734
api_audience=None,
12735+
metrics_interceptor=mock.ANY,
1272412736
)

0 commit comments

Comments
 (0)