Skip to content

Commit

Permalink
Add test for UNC bug gabrielcnr#33.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilderbuchi committed Sep 26, 2023
1 parent 776116f commit f135a88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_pathlib.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import pytest
import sys

from pytest_datadir.plugin import _win32_longpath


Expand All @@ -6,3 +9,10 @@ def test_win32_longpath_idempotent(datadir):
first = _win32_longpath(str(datadir))
second = _win32_longpath(first)
assert first == second


@pytest.mark.skipif(not sys.platform.startswith("win"), reason='Only makes sense on Windows')
def test_win32_longpath_unc(datadir):
unc_path = r'\\ComputerName\SharedFolder\Resource'
longpath = _win32_longpath(unc_path)
assert longpath.startswith('\\\\?\\UNC\\')

0 comments on commit f135a88

Please # to comment.