def _test_policy_failed(self, action, *args):
        rule_name = "os_compute_api:os-pci:%s" % action
        rule = {rule_name: "project:non_fake"}
        self.policy.set_rules(rule)
        exc = self.assertRaises(
            exception.PolicyNotAuthorized, getattr(self.controller, action),
            self.req, *args)
        self.assertEqual(
            rule_name % "Policy doesn't allow %s to be performed.",
            exc.format_message())
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_pci.py/PciControllerPolicyEnforcementV21._test_policy_failed/swapped operands of `%`