Skip to content

test(api-core): use re.fullmatch for strict UUID validation - #17797

Merged
hebaalazzeh merged 2 commits into
mainfrom
fix/uuid-validation-strict
Jul 20, 2026
Merged

test(api-core): use re.fullmatch for strict UUID validation#17797
hebaalazzeh merged 2 commits into
mainfrom
fix/uuid-validation-strict

Conversation

@hebaalazzeh

Copy link
Copy Markdown
Contributor

Description

This PR addresses code review feedback regarding test assertion strictness:

  • Changed the regex assertion from re.match to re.fullmatch for strict UUID validation in test_requests.py, ensuring trailing characters are not accepted.

@hebaalazzeh hebaalazzeh self-assigned this Jul 20, 2026
@hebaalazzeh
hebaalazzeh marked this pull request as ready for review July 20, 2026 23:07
@hebaalazzeh
hebaalazzeh requested a review from a team as a code owner July 20, 2026 23:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the unit test test_setup_request_id in packages/google-api-core/tests/unit/gapic/test_requests.py to use re.fullmatch instead of re.match when validating UUIDs against UUID_REGEX. There are no review comments, and I have no feedback to provide.

@hebaalazzeh
hebaalazzeh force-pushed the fix/uuid-validation-strict branch from 80f8ef2 to 1e7d8d4 Compare July 20, 2026 23:17
@hebaalazzeh
hebaalazzeh merged commit 8f55f89 into main Jul 20, 2026
39 checks passed
@hebaalazzeh
hebaalazzeh deleted the fix/uuid-validation-strict branch July 20, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants