Correct usage of transport_url in example

The example usage of transport_url in ConfFixture was not corrected when
the rest of the code was switched to using 'fake:/' for transport_url.
Since other projects will refer to this example to review changes, it
should be correct.

Also change the transport URLs used in test_transport to correspond to
the correct way of specifying virtual hosts.

Change-Id: If8e0a869e02fda2d8d2c86d82ef83ffc3a4361e4
This commit is contained in:
Steve Kowalik 2018-06-05 12:59:07 +10:00
parent 7e4ca449a0
commit 93280347ab
2 changed files with 8 additions and 5 deletions

View File

@ -37,7 +37,7 @@ class ConfFixture(fixtures.Fixture):
An example usage::
self.messaging_conf = self.useFixture(messaging.ConfFixture(cfg.CONF))
self.messaging_conf.transport_url = 'fake://'
self.messaging_conf.transport_url = 'fake:/'
:param conf: a ConfigOpts instance
:type conf: oslo.config.cfg.ConfigOpts

View File

@ -354,10 +354,13 @@ class TestTransportUrlCustomisation(test_utils.BaseTestCase):
def transport_url_parse(url):
return transport.TransportURL.parse(self.conf, url)
self.url1 = transport_url_parse("fake://vhost1?x=1&y=2&z=3")
self.url2 = transport_url_parse("fake://vhost2?foo=bar")
self.url3 = transport_url_parse("fake://vhost1?l=1&l=2&l=3")
self.url4 = transport_url_parse("fake://vhost2?d=x:1&d=y:2&d=z:3")
self.url1 = transport_url_parse(
"fake:/vhost1/localhost:5672/?x=1&y=2&z=3")
self.url2 = transport_url_parse("fake:/vhost2/localhost:5672/?foo=bar")
self.url3 = transport_url_parse(
"fake:/vhost1/localhost:5672/?l=1&l=2&l=3")
self.url4 = transport_url_parse(
"fake:/vhost2/localhost:5672/?d=x:1&d=y:2&d=z:3")
self.url5 = transport_url_parse("fake://noport:/?")
def test_hash(self):