def _check_authenticate(self, account=None, identity=None, headers=None,
                            exception=None, acl=None, env=None, path=None):
        if not identity:
            identity = self._get_identity()
        if not account:
            account = self._get_account(identity)
        if not path:
            path = account % '/v1/%s/c'
        # fake cached account info
        _, info_key = _get_cache_key(account, None)
        default_env = {'REMOTE_USER': identity['HTTP_X_TENANT_ID'],
                       info_key: {'status': 200, 'sysmeta': {}}}
        default_env.update(identity)
        if env:
            default_env.update(env)
        req = self._make_request(path, headers=headers, environ=default_env)
        req.acl = acl

        env_identity = self.test_auth._keystone_identity(req.environ)
        result = self.test_auth.authorize(env_identity, req)

        # if we have requested an exception but nothing came back then
        if exception and not result:
            self.fail("error %s was not returned" % (str(exception)))
        elif exception:
            self.assertEqual(result.status_int, exception)
        else:
            self.assertTrue(result is None)
        return req
dataset/ETHPy150Open openstack/swift/test/unit/common/middleware/test_keystoneauth.py/TestAuthorize._check_authenticate/swapped operands of `%`