Skip to content

Commit 2c8ec63

Browse files
committed
Demonstrate #1006
1 parent d11b848 commit 2c8ec63

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pyfakefs/tests/fake_pathlib_test.py

+17
Original file line numberDiff line numberDiff line change
@@ -1286,5 +1286,22 @@ def test_is_file_for_unreadable_dir_windows(self):
12861286
path.is_file()
12871287

12881288

1289+
class FakePathlibModulePurePathTest(unittest.TestCase):
1290+
def test_windows_pure_path_parsing(self):
1291+
"""Verify faked pure Windows paths use filesystem-independent separators."""
1292+
1293+
path = r"C:\Windows\cmd.exe"
1294+
self.assertEqual(
1295+
fake_pathlib.FakePathlibModule.PureWindowsPath(path).stem,
1296+
pathlib.PureWindowsPath(path).stem,
1297+
)
1298+
1299+
path = r"C:/Windows/cmd.exe"
1300+
self.assertEqual(
1301+
fake_pathlib.FakePathlibModule.PureWindowsPath(path).stem,
1302+
pathlib.PureWindowsPath(path).stem,
1303+
)
1304+
1305+
12891306
if __name__ == "__main__":
12901307
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)