This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
tests/unit/gapic/bigtable_v2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,32 +127,19 @@ def get_staging_dirs(
127127# fix tests
128128s .replace (
129129 "tests/unit/gapic/bigtable_v2/test_bigtable.py" ,
130- 'expected_headers = {"name": "projects/sample1/instances/sample2"}' ,
131- 'expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""}'
130+ 'gapic_v1\.routing_header\.to_grpc_metadata\(expected_headers\) in kw["metadata"]' ,
131+ """
132+ # assert the expected headers are present, in any order
133+ routing_string = next(iter([m[1] for m in kw["metadata"] if m[0] == 'x-goog-request-params']))
134+ assert all(
135+ [f"{k}={v}" for k,v in expected_headers.items() in routing_string]
136+ )
137+ """
132138)
133139s .replace (
134140 "tests/unit/gapic/bigtable_v2/test_bigtable.py" ,
135- """
136- "authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/sample4"
137- }
138- \)
139-
140- assert args\[0\] == request_msg
141-
142- expected_headers = {
143- "table_name": "projects/sample1/instances/sample2/tables/sample3",
144- """ ,
145- """
146- "authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/sample4"
147- }
148- )
149-
150- assert args[0] == request_msg
151-
152- expected_headers = {
153- "app_profile_id": "",
154- "table_name": "projects/sample1/instances/sample2/tables/sample3"
155- """
141+ 'expected_headers = {"name": "projects/sample1/instances/sample2"}' ,
142+ 'expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""}'
156143)
157144s .replace (
158145 "tests/unit/gapic/bigtable_v2/test_bigtable.py" ,
You can’t perform that action at this time.
0 commit comments