summaryrefslogtreecommitdiff
path: root/tests/test_urls.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-08-18 01:44:37 +0100
committerMark McLoughlin <markmc@redhat.com>2013-08-18 01:49:25 +0100
commit25647951087d8c8605c60d6231640ddb8acb614f (patch)
tree04634520ff0af8dbd3f11918ab3a43a5f1e4deec /tests/test_urls.py
parentc79bd1f24c2ee7a0c822db11f5ff0f764b711d03 (diff)
downloadoslo-messaging-1.2.0a8.tar.gz
Fix transport URL parsing bug1.2.0a8
Handle e.g. foo://u:p@/bar. Right now we get: IndexError: string index out of range from: if hostname[0] == '[': Change-Id: I0bccebb14ad1d37862955e8988d160240bd1cf6d
Diffstat (limited to 'tests/test_urls.py')
-rw-r--r--tests/test_urls.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_urls.py b/tests/test_urls.py
index a83ac40..84f5a17 100644
--- a/tests/test_urls.py
+++ b/tests/test_urls.py
@@ -78,6 +78,13 @@ class TestParseURL(test_utils.BaseTestCase):
dict(host='host', port=1234,
username='u', password='p'),
]))),
+ ('creds_no_host',
+ dict(url='foo://u:p@/bar',
+ expect=dict(transport='foo',
+ virtual_host='bar',
+ hosts=[
+ dict(username='u', password='p'),
+ ]))),
('multi_host',
dict(url='foo://u:p@host1:1234,host2:4321/bar',
expect=dict(transport='foo',