From 93280347ab6820a7eb0d869a80293b73020b8d8f Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 5 Jun 2018 12:59:07 +1000 Subject: [PATCH] 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 --- oslo_messaging/conffixture.py | 2 +- oslo_messaging/tests/test_transport.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/oslo_messaging/conffixture.py b/oslo_messaging/conffixture.py index 94f2f8977..2f75e9a07 100644 --- a/oslo_messaging/conffixture.py +++ b/oslo_messaging/conffixture.py @@ -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 diff --git a/oslo_messaging/tests/test_transport.py b/oslo_messaging/tests/test_transport.py index c37f352b4..6e320645d 100755 --- a/oslo_messaging/tests/test_transport.py +++ b/oslo_messaging/tests/test_transport.py @@ -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):