Skip to content

Commit e1f27a3

Browse files
committed
update goldens
1 parent bdaa00a commit e1f27a3

1 file changed

Lines changed: 18 additions & 21 deletions

File tree

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4209,17 +4209,16 @@ def test_create_job_rest_required_fields(request_type=storage_batch_operations.C
42094209
),
42104210
]
42114211
# Ensure that the uuid4 field is set according to AIP 4235
4212-
# and remove it so the expected/actual comparison succeeds.
4213-
# Otherwise, the actual will differ from the expected since
4214-
# this field was automatically populated.
4215-
found_field = None
42164212
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
42174213
if key == "requestId":
42184214
assert re.match(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
4219-
found_field = i
42204215
break
4221-
if found_field is not None:
4222-
del req.call_args.kwargs['params'][found_field]
4216+
4217+
# Include requestId within expected_params with value mock.ANY
4218+
expected_params = [p for p in expected_params if p[0] != "requestId"]
4219+
expected_params.append(
4220+
("requestId", mock.ANY)
4221+
)
42234222
actual_params = req.call_args.kwargs['params']
42244223
assert sorted(expected_params) == sorted(actual_params)
42254224

@@ -4388,17 +4387,16 @@ def test_delete_job_rest_required_fields(request_type=storage_batch_operations.D
43884387
expected_params = [
43894388
]
43904389
# Ensure that the uuid4 field is set according to AIP 4235
4391-
# and remove it so the expected/actual comparison succeeds.
4392-
# Otherwise, the actual will differ from the expected since
4393-
# this field was automatically populated.
4394-
found_field = None
43954390
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
43964391
if key == "requestId":
43974392
assert re.match(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
4398-
found_field = i
43994393
break
4400-
if found_field is not None:
4401-
del req.call_args.kwargs['params'][found_field]
4394+
4395+
# Include requestId within expected_params with value mock.ANY
4396+
expected_params = [p for p in expected_params if p[0] != "requestId"]
4397+
expected_params.append(
4398+
("requestId", mock.ANY)
4399+
)
44024400
actual_params = req.call_args.kwargs['params']
44034401
assert sorted(expected_params) == sorted(actual_params)
44044402

@@ -4565,17 +4563,16 @@ def test_cancel_job_rest_required_fields(request_type=storage_batch_operations.C
45654563
expected_params = [
45664564
]
45674565
# Ensure that the uuid4 field is set according to AIP 4235
4568-
# and remove it so the expected/actual comparison succeeds.
4569-
# Otherwise, the actual will differ from the expected since
4570-
# this field was automatically populated.
4571-
found_field = None
45724566
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
45734567
if key == "requestId":
45744568
assert re.match(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
4575-
found_field = i
45764569
break
4577-
if found_field is not None:
4578-
del req.call_args.kwargs['params'][found_field]
4570+
4571+
# Include requestId within expected_params with value mock.ANY
4572+
expected_params = [p for p in expected_params if p[0] != "requestId"]
4573+
expected_params.append(
4574+
("requestId", mock.ANY)
4575+
)
45794576
actual_params = req.call_args.kwargs['params']
45804577
assert sorted(expected_params) == sorted(actual_params)
45814578

0 commit comments

Comments
 (0)