diff options
author | James Slagle <jslagle@redhat.com> | 2013-11-15 07:12:00 -0500 |
---|---|---|
committer | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2013-11-21 16:21:56 +0000 |
commit | b2c0309f4c747a4f593b8cf1a05af15b7b74d7af (patch) | |
tree | cf46e40380734e1426301b9c18514afbe159de5f /ironic/tests/test_policy.py | |
parent | bc7b2eb15c1104625a5b355768b07f3b1cff52a2 (diff) | |
download | ironic-b2c0309f4c747a4f593b8cf1a05af15b7b74d7af.tar.gz |
Add missing ConfigNotFound exception
ConfigNotFound is raised as an exception from ironic.common.policy.py
if the policy file does not exist, yet the exception was not defined
in ironic.common.exception.py
Change-Id: Ic900c31c4fcad1ec27c54ab45af482293b51215c
Diffstat (limited to 'ironic/tests/test_policy.py')
-rw-r--r-- | ironic/tests/test_policy.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ironic/tests/test_policy.py b/ironic/tests/test_policy.py new file mode 100644 index 000000000..85cca1471 --- /dev/null +++ b/ironic/tests/test_policy.py @@ -0,0 +1,36 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# -*- encoding: utf-8 -*- +# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2013 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo.config import cfg + +from ironic.common import exception +from ironic.common import policy as ironic_policy +from ironic.tests import base + + +CONF = cfg.CONF + + +class PolicyTestCase(base.TestCase): + + def test_policy_file_not_found(self): + ironic_policy.reset() + CONF.set_override('policy_file', '/non/existant/policy/file') + self.assertRaises(exception.ConfigNotFound, ironic_policy.init) |