feat: Support non-mapped network drives on Windows.
Adds support for tracking files on network drives that are not mapped to a specific drive letter (e.g. X:\), but rather using a UNC path directly to the share, e.g. \\Mac\Home\Documents.
This commit is contained in:
parent
1252973086
commit
4fded99f98
2 changed files with 18 additions and 0 deletions
|
@ -27,6 +27,18 @@ class UtilsTestCase(TestCase):
|
|||
result = format_file_path(path)
|
||||
self.assertPathsEqual(expected, result)
|
||||
|
||||
def test_format_file_path_windows_network_mount(self):
|
||||
path = '\\\\some\\path////to\\\\\\a\\file.txt'
|
||||
expected = '//some/path/to/a/file.txt'
|
||||
|
||||
with mock.patch('os.path.realpath') as mock_realpath:
|
||||
mock_realpath.return_value = path
|
||||
with mock.patch('os.path.abspath') as mock_abspath:
|
||||
mock_abspath.return_value = path
|
||||
|
||||
result = format_file_path(path)
|
||||
self.assertPathsEqual(expected, result)
|
||||
|
||||
def test_format_file_path_handles_exceptions(self):
|
||||
path = 'c:\\some\\path////to\\\\\\a\\file.txt'
|
||||
expected = path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue