예제 #1
0
 def setUp(self):
     super(PolicyFixture, self).setUp()
     self.policy_dir = self.useFixture(fixtures.TempDir())
     self.policy_file_name = os.path.join(self.policy_dir.path,
                                          'policy.json')
     with open(self.policy_file_name, 'w') as policy_file:
         policy_file.write(fake_policy.policy_data)
     CONF.set_override('policy_file', self.policy_file_name)
     ironic_policy.reset()
     ironic_policy.init()
     self.addCleanup(ironic_policy.reset)
예제 #2
0
 def setUp(self):
     super(PolicyFixture, self).setUp()
     self.policy_dir = self.useFixture(fixtures.TempDir())
     self.policy_file_name = os.path.join(self.policy_dir.path,
                                          'policy.json')
     with open(self.policy_file_name, 'w') as policy_file:
         policy_file.write(fake_policy.policy_data)
     CONF.set_override('policy_file', self.policy_file_name)
     ironic_policy.reset()
     ironic_policy.init()
     self.addCleanup(ironic_policy.reset)
예제 #3
0
 def test_policy_file_not_found(self):
     ironic_policy.reset()
     CONF.set_override('policy_file', '/non/existent/policy/file')
     self.assertRaises(exception.ConfigNotFound, ironic_policy.init)
예제 #4
0
 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)