def test_configured_prefix(self):
     cfg.CONF.set_override('network_link_prefix', 'http://quantum.example')
     requrl = 'http://neutron.example/sub/ports.json?test=1'
     expected = 'http://quantum.example/sub/ports.json?test=1'
     self.assertEqual(expected, api_common.prepare_url(requrl))
 def test_no_configured_prefix(self):
     self.assertFalse(cfg.CONF.network_link_prefix)
     requrl = 'http://neutron.example/sub/ports.json?test=1'
     # should be unchanged
     self.assertEqual(requrl, api_common.prepare_url(requrl))
Beispiel #3
0
    def __init__(self, base_url):
        """Object initialization.

        :param base_url: url of the root wsgi application
        """
        self.base_url = api_common.prepare_url(base_url)
Beispiel #4
0
 def test_configured_prefix(self):
     cfg.CONF.set_override('network_link_prefix', 'http://quantum.example')
     requrl = 'http://neutron.example/sub/ports.json?test=1'
     expected = 'http://quantum.example/sub/ports.json?test=1'
     self.assertEqual(expected, api_common.prepare_url(requrl))
Beispiel #5
0
 def test_no_configured_prefix(self):
     self.assertFalse(cfg.CONF.network_link_prefix)
     requrl = 'http://neutron.example/sub/ports.json?test=1'
     # should be unchanged
     self.assertEqual(requrl, api_common.prepare_url(requrl))
Beispiel #6
0
    def __init__(self, base_url):
        """Object initialization.

        :param base_url: url of the root wsgi application
        """
        self.base_url = api_common.prepare_url(base_url)