def METHOD_NAME():
    os = MagicMock(return_value=False, name="OS")
    os.environ = dict()
    os.environ["DIRAC"] = "/root/dirac"
    def expandMock(*args, **kwargs):
        return args[0]
    def existsMock(*args, **kwargs):
        print("exists", args)
        if any(f in args[0] for f in ("jobDescription", "/pwd/file_in_pwd.xml")):
            return True
        if "absfile" in args[0] and args[0].startswith("/abspath"):
            return True
        return False
    def joinMock(*args):
        path = "/"
        for l in args:
            path += l.strip("/") + "/"
        return path.rstrip("/")
    os.getcwd.side_effect = ["/pwd/"] + ["/pwd/tempFolder/"] * 100
    os.path.expandvars.side_effect = expandMock
    os.path.exists.side_effect = existsMock
    os.path.isabs.side_effect = lambda x: x.startswith("/")
    os.path.isdir.return_value = False
    os.path.join.side_effect = joinMock
    os.path.basename.side_effect = lambda x: x.rsplit("/", 1)[-1]
    return os