Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def test_{{ method_name }}_empty_call():
{% if method_settings is not none %}
{% for auto_populated_field in method_settings.auto_populated_fields %}
# Ensure that the uuid4 field is set according to AIP 4235
assert re.match(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }})
assert re.fullmatch(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }})
# clear UUID field so that the check below succeeds
args[0].{{ auto_populated_field }} = None
{% endfor %}
Expand Down Expand Up @@ -730,7 +730,7 @@ def test_{{ method_name }}_non_empty_request_with_auto_populated_field():
{% if method_settings is not none %}
{% for auto_populated_field in method_settings.auto_populated_fields %}
# Ensure that the uuid4 field is set according to AIP 4235
assert re.match(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }})
assert re.fullmatch(r"{{ uuid4_re }}", args[0].{{ auto_populated_field }})
# clear UUID field so that the check below succeeds
args[0].{{ auto_populated_field }} = None
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_{{ method_name }}_non_empty_request_with_auto_populated_field():
{% if method_settings is not none %}
{% for auto_populated_field in method_settings.auto_populated_fields %}
# Ensure that the uuid4 field is set according to AIP 4235
assert re.match(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }})
assert re.fullmatch(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }})
# clear UUID field so that the check below succeeds
args[0].{{ auto_populated_field }} = None
{% endfor %}
Expand Down Expand Up @@ -1224,7 +1224,7 @@ def test_{{ method_name }}_rest_required_fields(request_type={{ method.input.ide
# Ensure that the uuid4 field is set according to AIP 4235
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
if key == "{{ auto_populated_field|camel_case }}":
assert re.match(r"{{ get_uuid4_re() }}", value)
assert re.fullmatch(r"{{ get_uuid4_re() }}", value)
break

# Include {{ auto_populated_field|camel_case }} within expected_params with value mock.ANY
Expand Down Expand Up @@ -1576,7 +1576,7 @@ def test_{{ method_name }}_rest_no_http_options():
{% if method_settings is not none %}
{% for auto_populated_field in method_settings.auto_populated_fields %}
# Ensure that the uuid4 field is set according to AIP 4235
assert re.match(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }})
assert re.fullmatch(r"{{ get_uuid4_re() }}", args[0].{{ auto_populated_field }})
# clear UUID field so that the check below succeeds
args[0].{{ auto_populated_field }} = None
{% endfor %}{# for auto_populated_field in method_settings.auto_populated_fields #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,7 @@ def test_create_job_non_empty_request_with_auto_populated_field():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
assert args[0] == storage_batch_operations.CreateJobRequest(
Expand Down Expand Up @@ -2215,7 +2215,7 @@ def test_delete_job_non_empty_request_with_auto_populated_field():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
assert args[0] == storage_batch_operations.DeleteJobRequest(
Expand Down Expand Up @@ -2533,7 +2533,7 @@ def test_cancel_job_non_empty_request_with_auto_populated_field():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
assert args[0] == storage_batch_operations.CancelJobRequest(
Expand Down Expand Up @@ -4135,7 +4135,7 @@ def test_create_job_rest_required_fields(request_type=storage_batch_operations.C
# Ensure that the uuid4 field is set according to AIP 4235
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
if key == "requestId":
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)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
break

# Include requestId within expected_params with value mock.ANY
Expand Down Expand Up @@ -4313,7 +4313,7 @@ def test_delete_job_rest_required_fields(request_type=storage_batch_operations.D
# Ensure that the uuid4 field is set according to AIP 4235
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
if key == "requestId":
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)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
break

# Include requestId within expected_params with value mock.ANY
Expand Down Expand Up @@ -4489,7 +4489,7 @@ def test_cancel_job_rest_required_fields(request_type=storage_batch_operations.C
# Ensure that the uuid4 field is set according to AIP 4235
for i, (key, value) in enumerate(req.call_args.kwargs['params']):
if key == "requestId":
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)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", value)
break

# Include requestId within expected_params with value mock.ANY
Expand Down Expand Up @@ -5125,7 +5125,7 @@ def test_create_job_empty_call_grpc():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CreateJobRequest()
Expand All @@ -5152,7 +5152,7 @@ def test_delete_job_empty_call_grpc():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.DeleteJobRequest()
Expand All @@ -5179,7 +5179,7 @@ def test_cancel_job_empty_call_grpc():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CancelJobRequest()
Expand Down Expand Up @@ -5330,7 +5330,7 @@ async def test_create_job_empty_call_grpc_asyncio():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CreateJobRequest()
Expand Down Expand Up @@ -5359,7 +5359,7 @@ async def test_delete_job_empty_call_grpc_asyncio():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.DeleteJobRequest()
Expand Down Expand Up @@ -5389,7 +5389,7 @@ async def test_cancel_job_empty_call_grpc_asyncio():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CancelJobRequest()
Expand Down Expand Up @@ -6647,7 +6647,7 @@ def test_create_job_empty_call_rest():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CreateJobRequest()
Expand All @@ -6673,7 +6673,7 @@ def test_delete_job_empty_call_rest():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.DeleteJobRequest()
Expand All @@ -6699,7 +6699,7 @@ def test_cancel_job_empty_call_rest():
call.assert_called()
_, args, _ = call.mock_calls[0]
# Ensure that the uuid4 field is set according to AIP 4235
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}", args[0].request_id)
assert re.fullmatch(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}", args[0].request_id)
# clear UUID field so that the check below succeeds
args[0].request_id = None
request_msg = storage_batch_operations.CancelJobRequest()
Expand Down
Loading