def test_update_policy_failed(self):
        rule_name = "os_compute_api:os-agents"
        self.policy.set_rules({rule_name: "project_id:non_fake"})
        exc = self.assertRaises(
            exception.PolicyNotAuthorized,
            self.controller.update, self.req, fakes.FAKE_UUID,
            body={'para': {'version': '7.0',
                           'url': 'xxx://xxxx/xxx/xxx',
                           'md5hash': 'add6bb58e139be103324d04d82d8f545'}})
        self.assertEqual(
            "Policy doesn't allow %s to be performed." % rule_name,
            exc.format_message())
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_agents.py/AgentsPolicyEnforcementV21.test_update_policy_failed/original