diff options
author | David Lord <davidism@gmail.com> | 2021-08-14 05:08:24 -0700 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-08-14 05:08:24 -0700 |
commit | cd5d1888e2009bc4ea17ab1869a36475f1678970 (patch) | |
tree | b83005ef35e779b351b85a4fbf3acec84936cd49 /tests | |
parent | c3687bf1d2d5c175ee50dc083fce5b19de152de0 (diff) | |
parent | 09b9d614ac79e2c97f5f486a30231be1e8fe68ad (diff) | |
download | click-cd5d1888e2009bc4ea17ab1869a36475f1678970.tar.gz |
Merge remote-tracking branch 'origin/8.0.x'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_types.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_types.py b/tests/test_types.py index 58d1b68..dff8172 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -126,4 +126,15 @@ def test_symlink_resolution(tmpdir, sym_file, abs_fun): # test ctx = click.Context(click.Command("do_stuff")) rv = click.Path(resolve_path=True).convert(sym_path, None, ctx) + + # os.readlink prepends path prefixes to absolute + # links in windows. + # https://docs.microsoft.com/en-us/windows/win32/ + # ... fileio/naming-a-file#win32-file-namespaces + # + # Here we strip win32 path prefix from the resolved path + rv_drive, rv_path = os.path.splitdrive(rv) + stripped_rv_drive = rv_drive.split(os.path.sep)[-1] + rv = os.path.join(stripped_rv_drive, rv_path) + assert rv == real_path |