Skip to content

Commit

Permalink
Demonstrate pytest-dev#1006
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtmckee committed May 4, 2024
1 parent d11b848 commit 2c8ec63
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pyfakefs/tests/fake_pathlib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,5 +1286,22 @@ def test_is_file_for_unreadable_dir_windows(self):
path.is_file()


class FakePathlibModulePurePathTest(unittest.TestCase):
def test_windows_pure_path_parsing(self):
"""Verify faked pure Windows paths use filesystem-independent separators."""

path = r"C:\Windows\cmd.exe"
self.assertEqual(
fake_pathlib.FakePathlibModule.PureWindowsPath(path).stem,
pathlib.PureWindowsPath(path).stem,
)

path = r"C:/Windows/cmd.exe"
self.assertEqual(
fake_pathlib.FakePathlibModule.PureWindowsPath(path).stem,
pathlib.PureWindowsPath(path).stem,
)


if __name__ == "__main__":
unittest.main(verbosity=2)

0 comments on commit 2c8ec63

Please sign in to comment.