Merge "Fix config error"

This commit is contained in:
Jenkins authored and Gerrit Code Review committed 2016-03-28 23:29:25 +00:00
commit ef1702fe38
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ def load_app():
cfg_file = cfg_path
if not cfg_file:
raise cfg.ConfigFilesNotFoundError([cfg.CONF.api_paste_config])
raise cfg.ConfigFilesNotFoundError([cfg.CONF.api.api_paste_config])
LOG.info(_("Full WSGI config used: %s") % cfg_file)
return deploy.loadapp("config:" + cfg_file)
@@ -102,6 +102,13 @@ class TestRootController(api_base.FunctionalTest):
response = self.app.get('/a/bogus/url', expect_errors=True)
assert response.status_int == 404
def test_api_paste_file_not_exist(self):
cfg.CONF.set_override('api_paste_config', 'non-existent-file',
group='api')
with mock.patch.object(cfg.CONF, 'find_file') as ff:
ff.return_value = None
self.assertRaises(cfg.ConfigFilesNotFoundError, app.load_app)
def test_noauth(self):
# Don't need to auth
paste_file = "magnum/tests/unit/api/controllers/noauth-paste.ini"