247 lines
9.2 KiB
Python
Raw Normal View History

2013-06-16 15:37:56 +01:00
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
from oslo.config import cfg
2013-06-16 15:37:56 +01:00
import testscenarios
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
from oslo import messaging
from oslo.messaging import transport
2013-06-16 15:37:56 +01:00
from tests import utils as test_utils
load_tests = testscenarios.load_tests_apply_scenarios
class TestParseURL(test_utils.BaseTestCase):
scenarios = [
('transport',
dict(url='foo:', aliases=None,
expect=dict(transport='foo'))),
('transport_aliased',
dict(url='bar:', aliases=dict(bar='foo'),
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expect=dict(transport='foo'))),
('virtual_host_slash',
dict(url='foo:////', aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expect=dict(transport='foo', virtual_host='/'))),
('virtual_host',
dict(url='foo:///bar', aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expect=dict(transport='foo', virtual_host='bar'))),
2013-06-16 15:37:56 +01:00
('host',
dict(url='foo://host/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host'),
]))),
('ipv6_host',
dict(url='foo://[ffff::1]/bar', aliases=None,
expect=dict(transport='foo',
virtual_host='bar',
hosts=[
dict(host='ffff::1'),
]))),
2013-06-16 15:37:56 +01:00
('port',
dict(url='foo://host:1234/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host', port=1234),
]))),
('ipv6_port',
dict(url='foo://[ffff::1]:1234/bar', aliases=None,
expect=dict(transport='foo',
virtual_host='bar',
hosts=[
dict(host='ffff::1', port=1234),
]))),
2013-06-16 15:37:56 +01:00
('username',
dict(url='foo://u@host:1234/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host', port=1234, username='u'),
]))),
2013-06-16 15:37:56 +01:00
('password',
dict(url='foo://u:p@host:1234/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host', port=1234,
username='u', password='p'),
]))),
('creds_no_host',
dict(url='foo://u:p@/bar', aliases=None,
expect=dict(transport='foo',
virtual_host='bar',
hosts=[
dict(username='u', password='p'),
]))),
2013-06-16 15:37:56 +01:00
('multi_host',
dict(url='foo://u:p@host1:1234,host2:4321/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host1', port=1234,
username='u', password='p'),
dict(host='host2', port=4321),
]))),
2013-06-16 15:37:56 +01:00
('multi_creds',
dict(url='foo://u1:p1@host1:1234,u2:p2@host2:4321/bar', aliases=None,
2013-06-16 15:37:56 +01:00
expect=dict(transport='foo',
virtual_host='bar',
2013-06-16 15:37:56 +01:00
hosts=[
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
dict(host='host1', port=1234,
username='u1', password='p1'),
dict(host='host2', port=4321,
username='u2', password='p2'),
]))),
('multi_creds_ipv6',
dict(url='foo://u1:p1@[ffff::1]:1234,u2:p2@[ffff::2]:4321/bar',
aliases=None,
expect=dict(transport='foo',
virtual_host='bar',
hosts=[
dict(host='ffff::1', port=1234,
username='u1', password='p1'),
dict(host='ffff::2', port=4321,
username='u2', password='p2'),
]))),
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
]
def setUp(self):
super(TestParseURL, self).setUp(conf=cfg.ConfigOpts())
self.conf.register_opts(transport._transport_opts)
def test_parse_url(self):
self.config(rpc_backend=None)
url = messaging.TransportURL.parse(self.conf, self.url, self.aliases)
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
hosts = []
for host in self.expect.get('hosts', []):
hosts.append(messaging.TransportHost(host.get('host'),
host.get('port'),
host.get('username'),
host.get('password')))
expected = messaging.TransportURL(self.conf,
self.expect.get('transport'),
self.expect.get('virtual_host'),
hosts)
self.assertEqual(url, expected)
class TestFormatURL(test_utils.BaseTestCase):
scenarios = [
('rpc_backend',
dict(rpc_backend='testbackend',
transport=None,
virtual_host=None,
hosts=[],
aliases=None,
expected='testbackend:///')),
('rpc_backend_aliased',
dict(rpc_backend='testfoo',
transport=None,
virtual_host=None,
hosts=[],
aliases=dict(testfoo='testbackend'),
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testbackend:///')),
('transport',
dict(rpc_backend=None,
transport='testtransport',
virtual_host=None,
hosts=[],
aliases=None,
expected='testtransport:///')),
('transport_aliased',
dict(rpc_backend=None,
transport='testfoo',
virtual_host=None,
hosts=[],
aliases=dict(testfoo='testtransport'),
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testtransport:///')),
('virtual_host',
dict(rpc_backend=None,
transport='testtransport',
virtual_host='/vhost',
hosts=[],
aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testtransport:////vhost')),
('host',
dict(rpc_backend=None,
transport='testtransport',
virtual_host='/',
hosts=[
dict(hostname='host',
port=10,
username='bob',
password='secret'),
],
aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testtransport://bob:secret@host:10//')),
('multi_host',
dict(rpc_backend=None,
transport='testtransport',
virtual_host='',
hosts=[
dict(hostname='h1',
port=1000,
username='b1',
password='s1'),
dict(hostname='h2',
port=2000,
username='b2',
password='s2'),
],
aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testtransport://b1:s1@h1:1000,b2:s2@h2:2000/')),
('quoting',
dict(rpc_backend=None,
transport='testtransport',
virtual_host='/$',
hosts=[
dict(hostname='host',
port=10,
username='b$',
password='s&'),
],
aliases=None,
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
expected='testtransport://b%24:s%26@host:10//%24')),
2013-06-16 15:37:56 +01:00
]
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
def setUp(self):
super(TestFormatURL, self).setUp(conf=cfg.ConfigOpts())
self.conf.register_opts(transport._transport_opts)
2013-06-16 15:37:56 +01:00
def test_parse_url(self):
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
self.config(rpc_backend=self.rpc_backend)
hosts = []
for host in self.hosts:
hosts.append(messaging.TransportHost(host.get('hostname'),
host.get('port'),
host.get('username'),
host.get('password')))
url = messaging.TransportURL(self.conf,
self.transport,
self.virtual_host,
hosts,
self.aliases)
Add a TransportURL class to the public API Nova's cells/rpc_driver.py has some code which allows user of the REST API to update elements of a cell's transport URL (say, the host name of the message broker) stored in the database. To achieve this, it has a parse_transport_url() method which breaks the URL into its constituent parts and an unparse_transport_url() which re-forms it again after updating some of its parts. This is all fine and, since it's fairly specialized, it wouldn't be a big deal to leave this code in Nova for now ... except the unparse method looks at CONF.rpc_backend to know what scheme to use in the returned URL if now backend was specified. oslo.messaging registers the rpc_backend option, but the ability to reference any option registered by the library should not be relied upon by users of the library. Imagine, for instance, if we renamed the option in future (with backwards compat for old configurations), then this would mean API breakage. So, long story short - an API along these lines makes some sense, but especially since not having it would mean we'd need to add some way to query the name of the transport driver. In this commit, we add a simple new TransportURL class: >>> url = messaging.TransportURL.parse(cfg.CONF, 'foo:///') >>> str(url), url ('foo:///', <TransportURL transport='foo'>) >>> url.hosts.append(messaging.TransportHost(hostname='localhost')) >>> str(url), url ('foo://localhost/', <TransportURL transport='foo', hosts=[<TransportHost hostname='localhost'>]>) >>> url.transport = None >>> str(url), url ('kombu://localhost/', <TransportURL transport='kombu', hosts=[<TransportHost hostname='localhost'>]>) >>> cfg.CONF.set_override('rpc_backend', 'bar') >>> str(url), url ('bar://localhost/', <TransportURL transport='bar', hosts=[<TransportHost hostname='localhost'>]>) The TransportURL.parse() method equates to parse_transport_url() and TransportURL.__str__() equates to unparse_transport(). The transport drivers are also updated to take a TransportURL as a required argument, which simplifies the handling of transport URLs in the drivers. Change-Id: Ic04173476329858e4a2c2d2707e9d4aeb212d127
2013-08-12 17:16:44 +01:00
self.assertEqual(str(url), self.expected)