Python os.path.samefile() Examples

The following are code examples for showing how to use os.path.samefile(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: Ansible-Example-AB2018   Author: umit-ozturk   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 2
Project: mealpy   Author: edmundmok   File: venv_update.py    MIT License 6 votes vote down vote up
def invalid_virtualenv_reason(venv_path, source_python, destination_python, options):
    try:
        orig_path = get_original_path(venv_path)
    except CalledProcessError:
        return 'could not inspect metadata'
    if not samefile(orig_path, venv_path):
        return 'virtualenv moved %s -> %s' % (timid_relpath(orig_path), timid_relpath(venv_path))
    elif has_system_site_packages(destination_python) != options.system_site_packages:
        return 'system-site-packages changed, to %s' % options.system_site_packages

    if source_python is None:
        return
    destination_version = get_python_version(destination_python)
    source_version = get_python_version(source_python)
    if source_version != destination_version:
        return 'python version changed %s -> %s' % (destination_version, source_version) 
Example 3
Project: aws-cfn-plex   Author: lordmuffin   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 4
Project: splunk-google-drive   Author: LukeMurphey   File: ffiplatform.py    Apache License 2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 5
Project: banruo   Author: yingshang   File: ffiplatform.py    GNU Lesser General Public License v3.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 6
Project: open-recipe   Author: dspray95   File: ffiplatform.py    The Unlicense 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 7
Project: tweet-the-wolf   Author: theshteves   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 8
Project: cqp-sdk-for-py37-native   Author: crud-boy   File: ffiplatform.py    GNU General Public License v2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 9
Project: aws-lambda-runtime-pypy   Author: uscheller   File: ffiplatform.py    Apache License 2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 10
Project: oss-ftp   Author: aliyun   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 11
Project: Safejumper-for-Desktop   Author: proxysh   File: ffiplatform.py    GNU General Public License v2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 12
Project: SwiftKitten   Author: johncsnyder   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 13
Project: noc-orchestrator   Author: DirceuSilvaLabs   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 14
Project: noc-orchestrator   Author: DirceuSilvaLabs   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 15
Project: TFTHelper   Author: AliMZaini   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 16
Project: weibo_twitter_earnings_analysis   Author: lynings   File: ffiplatform.py    Apache License 2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 17
Project: learn_python3_spider   Author: wistbean   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 18
Project: learn_python3_spider   Author: wistbean   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 19
Project: PoliNetworkBotPython   Author: PoliNetwork   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 20
Project: PoliNetworkBotPython   Author: PoliNetwork   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 21
Project: myBlog   Author: adxc   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 22
Project: BL-Bot   Author: IOIIIO   File: ffiplatform.py    GNU General Public License v3.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 23
Project: luscan-devel   Author: blackye   File: localfile.py    GNU General Public License v2.0 6 votes vote down vote up
def samefile(self, f1, f2):
        """
        Determine if the two given filenames point to the same file
        within the plugin folder.

        :param f1: Name of the first file to test.
        :type f1: str

        :param f2: Name of the second file to test.
        :type f2: str

        :returns: True if the files are the same, False otherwise.
        :rtype: bool
        """

        # Sanitize the filenames.
        f1 = self.__sanitize(f1)
        f2 = self.__sanitize(f2)

        # Test the filenames.
        return path.samefile(f1, f2)


    #-------------------------------------------------------------------------- 
Example 24
Project: Light_control   Author: laurent-colas   File: ffiplatform.py    The Unlicense 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 25
Project: alfred-salesforce   Author: jereze   File: ffiplatform.py    Apache License 2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 26
Project: tf-rancher-2.0   Author: jgreat   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 27
Project: tf-rancher-2.0   Author: jgreat   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 28
Project: Ridr_app   Author: RydrDojo   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 29
Project: git-integration-aws   Author: droidlabour   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 30
Project: lambda-OCRmyPDF   Author: chronograph-pe   File: ffiplatform.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 31
Project: vim-hdl   Author: suoto   File: config_gen_wrapper.py    GNU General Public License v3.0 6 votes vote down vote up
def _openResultingFileForEdit(self):
        """
        Opens the resulting conf file for editing so the user can tweak and
        test
        """
        self._logger.debug("Opening resulting file for edition")
        # If the current buffer is already pointing to the project file, reuse
        # it
        if not p.exists(vim.current.buffer.name) or p.samefile(
            vim.current.buffer.name, self._project_file
        ):
            vim.command("edit! %s" % self._project_file)
        else:
            vim.command("vsplit %s" % self._project_file)

        vim.current.buffer.vars["is_vimhdl_generated"] = True
        vim.command("set filetype=vimhdl") 
Example 32
Project: iiita-updates   Author: mrsaicharan1   File: ffiplatform.py    Apache License 2.0 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 33
Project: monKey-server   Author: Amirh24   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 34
Project: monKey-server   Author: Amirh24   File: ffiplatform.py    MIT License 6 votes vote down vote up
def maybe_relative_path(path):
    if not os.path.isabs(path):
        return path      # already relative
    dir = path
    names = []
    while True:
        prevdir = dir
        dir, name = os.path.split(prevdir)
        if dir == prevdir or not dir:
            return path     # failed to make it relative
        names.append(name)
        try:
            if samefile(dir, os.curdir):
                names.reverse()
                return os.path.join(*names)
        except OSError:
            pass

# ____________________________________________________________ 
Example 35
Project: Ansible-Example-AB2018   Author: umit-ozturk   File: ffiplatform.py    MIT License 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 36
Project: mealpy   Author: edmundmok   File: venv_update.py    MIT License 5 votes vote down vote up
def samefile(file1, file2):
    if not exists(file1) or not exists(file2):
        return False
    else:
        from os.path import samefile
        return samefile(file1, file2) 
Example 37
Project: apple-emoji-linux   Author: samuelngs   File: svg_cleaner.py    Apache License 2.0 5 votes vote down vote up
def clean_svg_files(in_dir, out_dir, match_pat=None, clean=False, strip=False):
  regex = re.compile(match_pat) if match_pat else None
  count = 0

  if clean and path.samefile(in_dir, out_dir):
    logging.error('Cannot clean %s (same as in_dir)', out_dir)
    return

  out_dir = tool_utils.ensure_dir_exists(out_dir, clean=clean)

  cleaner = SvgCleaner(strip)
  for file_name in os.listdir(in_dir):
    if regex and not regex.match(file_name):
      continue
    in_path = os.path.join(in_dir, file_name)
    logging.debug('read: %s', in_path)
    with open(in_path) as in_fp:
      result = cleaner.clean_svg(in_fp.read())
    out_path = os.path.join(out_dir, file_name)
    with codecs.open(out_path, 'w', 'utf-8') as out_fp:
      logging.debug('write: %s', out_path)
      out_fp.write(result)
      count += 1
  if not count:
    logging.warning('Failed to match any files')
  else:
    logging.info('Wrote %s files to %s', count, out_dir) 
Example 38
Project: aws-cfn-plex   Author: lordmuffin   File: ffiplatform.py    MIT License 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 39
Project: splunk-google-drive   Author: LukeMurphey   File: ffiplatform.py    Apache License 2.0 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 40
Project: banruo   Author: yingshang   File: ffiplatform.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 41
Project: pycosio   Author: Accelize   File: functions_os_path.py    Apache License 2.0 5 votes vote down vote up
def samefile(path1, path2):
    """
    Return True if both pathname arguments refer to the same file or directory.

    Equivalent to "os.path.samefile".

    Args:
        path1 (path-like object): Path or URL.
        path2 (path-like object): Path or URL.

    Returns:
        bool: True if same file or directory.
    """
    # Handles path-like objects and checks if storage
    path1, path1_is_storage = format_and_is_storage(path1)
    path2, path2_is_storage = format_and_is_storage(path2)

    # Local files: Redirects to "os.path.samefile"
    if not path1_is_storage and not path2_is_storage:
        return os_path_samefile(path1, path2)

    # One path is local, the other storage
    if not path1_is_storage or not path2_is_storage:
        return False

    with handle_os_exceptions():
        # Paths don't use same storage
        system = get_instance(path1)
        if system is not get_instance(path2):
            return False

        # Relative path are different
        elif system.relpath(path1) != system.relpath(path2):
            return False

    # Same files
    return True 
Example 42
Project: open-recipe   Author: dspray95   File: ffiplatform.py    The Unlicense 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 43
Project: tweet-the-wolf   Author: theshteves   File: ffiplatform.py    MIT License 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 44
Project: cqp-sdk-for-py37-native   Author: crud-boy   File: ffiplatform.py    GNU General Public License v2.0 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 45
Project: aws-lambda-runtime-pypy   Author: uscheller   File: ffiplatform.py    Apache License 2.0 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 46
Project: setuptools_scm   Author: pypa   File: git.py    MIT License 5 votes vote down vote up
def from_potential_worktree(cls, wd):
        real_wd, _, ret = do_ex("git rev-parse --show-toplevel", wd)
        if ret:
            return
        trace("real root", real_wd)
        if not samefile(real_wd, wd):
            return

        return cls(real_wd) 
Example 47
Project: oss-ftp   Author: aliyun   File: ffiplatform.py    MIT License 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 48
Project: Safejumper-for-Desktop   Author: proxysh   File: ffiplatform.py    GNU General Public License v2.0 5 votes vote down vote up
def samefile(f1, f2):
        return os.path.abspath(f1) == os.path.abspath(f2) 
Example 49
Project: pymongo_inmemory   Author: kaizendorks   File: test_downloader.py    MIT License 5 votes vote down vote up
def test_default_bin_folder(monkeypatch, tmpdir):
    monkeypatch.setattr(downloader, "CACHE_FOLDER", tmpdir)
    assert path.samefile(
        downloader.bin_folder(),
        path.join(tmpdir, "bin")
    ) 
Example 50
Project: pymongo_inmemory   Author: kaizendorks   File: test_downloader.py    MIT License 5 votes vote down vote up
def test_default_dl_folder(monkeypatch, tmpdir):
    monkeypatch.setattr(downloader, "CACHE_FOLDER", tmpdir)
    assert path.samefile(
        downloader._download_folder(),
        path.join(tmpdir, "download")
    )