Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testcase and fix #2221

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
1 change: 0 additions & 1 deletion kombu/transport/azureservicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
# dots are replaced by dash, all other punctuation replaced by underscore.
PUNCTUATIONS_TO_REPLACE = set(string.punctuation) - {'_', '.', '-'}
CHARS_REPLACE_TABLE = {
ord('.'): ord('-'),
**{ord(c): ord('_') for c in PUNCTUATIONS_TO_REPLACE}
}

Expand Down
7 changes: 5 additions & 2 deletions t/unit/transport/test_azureservicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,12 @@ def test_custom_entity_name():
conn = Connection(URL_CREDS_SAS, transport=azureservicebus.Transport)
channel = conn.channel()

# dashes allowed and dots replaced by dashes
# dashes allowed
assert channel.entity_name('test-celery') == 'test-celery'
assert channel.entity_name('test.celery') == 'test-celery'

# dots allowed
# cf. https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules
assert channel.entity_name('test.celery') == 'test.celery'

# all other punctuations replaced by underscores
assert channel.entity_name('test_celery') == 'test_celery'
Expand Down