Пример #1
0
 def test_not_found_app_is_none(self):
     local_conf = {'not_found_app': None,
                   'domain foobar.com port 20 /': 'some_app_local'}
     self.loader.get_app('some_app_local', global_conf=self.global_conf).\
         AndReturn('some_app_returned_by_loader')
     self.mox.ReplayAll()
     expected_urlmap = urlmap.URLMap(not_found_app=None)
     expected_urlmap['http://foobar.com:20'] = 'some_app_returned'\
                                               '_by_loader'
     self.assertEqual(urlmap.urlmap_factory(self.loader, self.global_conf,
                                            **local_conf), expected_urlmap)
Пример #2
0
    def test_not_found_app_is_none(self):
        local_conf = {'not_found_app': None,
                      'domain foobar.com port 20 /': 'some_app_local'}
        self.loader.get_app.return_value = 'some_app_returned_by_loader'

        expected_urlmap = urlmap.URLMap(not_found_app=None)
        expected_urlmap['http://foobar.com:20'] = 'some_app_returned'\
                                                  '_by_loader'
        self.assertEqual(expected_urlmap,
                         urlmap.urlmap_factory(self.loader, self.global_conf,
                                               **local_conf))
        self.loader.get_app.assert_called_once_with(
            'some_app_local', global_conf=self.global_conf)
Пример #3
0
 def test_not_found_app_not_in_local_conf(self):
     local_conf = {'domain foobar.com port 20 /': 'some_app_local'}
     self.loader.get_app('app_global', global_conf=self.global_conf).\
         AndReturn('app_global_loader')
     self.loader.get_app('some_app_local', global_conf=self.global_conf).\
         AndReturn('some_app_returned_by_loader')
     self.mox.ReplayAll()
     expected_urlmap = urlmap.URLMap(not_found_app='app_global_loader')
     expected_urlmap['http://foobar.com:20'] = 'some_app_returned'\
                                               '_by_loader'
     self.assertEqual(
         expected_urlmap,
         urlmap.urlmap_factory(self.loader, self.global_conf, **local_conf))
Пример #4
0
    def test_not_found_app_not_in_local_conf(self):
        local_conf = {'domain foobar.com port 20 /': 'some_app_local'}

        self.loader.get_app.side_effect = ['app_global_loader',
                                           'some_app_returned_by_loader']
        calls = [mock.call('app_global', global_conf=self.global_conf),
                 mock.call('some_app_local', global_conf=self.global_conf)]

        expected_urlmap = urlmap.URLMap(not_found_app='app_global_loader')
        expected_urlmap['http://foobar.com:20'] = 'some_app_returned'\
                                                  '_by_loader'
        self.assertEqual(expected_urlmap,
                         urlmap.urlmap_factory(self.loader, self.global_conf,
                                               **local_conf))
        self.loader.get_app.assert_has_calls(calls)
Пример #5
0
def urlmap_factory(loader, global_conf, **local_conf):
    LOG.warn(
        _('cinder.api.openstack.urlmap:urlmap_factory is deprecated. '
          'Please use cinder.api.urlmap:urlmap_factory instead.'))
    urlmap.urlmap_factory(loader, global_conf, **local_conf)
Пример #6
0
def urlmap_factory(loader, global_conf, **local_conf):
    LOG.warn(_('cinder.api.openstack.urlmap:urlmap_factory is deprecated. '
             'Please use cinder.api.urlmap:urlmap_factory instead.'))
    urlmap.urlmap_factory(loader, global_conf, **local_conf)