Skip to content

Add unit tests for is_compliant_user_id_localpart - #20164

Open
guillemo12 wants to merge 2 commits into
element-hq:developfrom
guillemo12:test/is-compliant-user-id-localpart
Open

Add unit tests for is_compliant_user_id_localpart#20164
guillemo12 wants to merge 2 commits into
element-hq:developfrom
guillemo12:test/is-compliant-user-id-localpart

Conversation

@guillemo12

@guillemo12 guillemo12 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What I hope to achieve

Add missing unit test coverage for is_compliant_user_id_localpart in synapse/types/__init__.py.

How it addresses those goals

Added IsCompliantUserIdLocalpartTestCase in tests/test_types.py covering:

  • Empty strings
  • Compliant ASCII characters within the range U+0021 to U+007E (alphanumeric and valid symbols)
  • Non-compliant characters (spaces, non-ASCII characters, control characters, tabs, newlines, and DEL \x7f).

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@guillemo12
guillemo12 requested a review from a team as a code owner August 28, 2026 16:05
@guillemo12
guillemo12 requested review from MadLittleMods and removed request for a team August 28, 2026 16:05
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.

1 participant