diff --git a/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index fcbeeff213b5..c68b390b7c84 100644 --- a/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -107,7 +107,7 @@ CRED_INFO_JSON = { "principal": "service-account@example.com", } CRED_INFO_STRING = json.dumps(CRED_INFO_JSON) -{% if api.all_method_settings.values()|map(attribute="auto_populated_fields", default=[])|list %} +{% if api.all_method_settings.values()|map(attribute="auto_populated_fields", default=[])|select|list %} _UUID4_RE = re.compile(r"{{ uuid4_re }}") {% endif %} diff --git a/packages/gapic-generator/gapic/utils/constants.py b/packages/gapic-generator/gapic/utils/constants.py index e21f7cd2170f..a881e2eabac8 100644 --- a/packages/gapic-generator/gapic/utils/constants.py +++ b/packages/gapic-generator/gapic/utils/constants.py @@ -13,4 +13,4 @@ # limitations under the License. # The regex for a UUID4 as specified in AIP-4235. -UUID4_RE = r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}" +UUID4_RE = r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}" # pragma: NO COVER