-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UNC bug in _win32_longpath (#34)
Fixes #33
- Loading branch information
1 parent
0b5bb4d
commit 5a054df
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import sys | ||
|
||
import pytest | ||
from pytest_datadir.plugin import _win32_longpath | ||
|
||
|
||
def test_win32_longpath_idempotent(datadir): | ||
"""Double application should not prepend twice.""" | ||
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\\") |