Skip to content

Commit

Permalink
Add tests for os.PathLike
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Dec 22, 2020
1 parent 5928334 commit 4c77ddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tests/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,5 @@ def __init__(self, *args: str):
def __fspath__(self):
return self._path

def __str__(self):
return self._path

def __eq__(self, other):
return isinstance(other, CustomPath) and self._path == other._path
2 changes: 2 additions & 0 deletions tests/test_data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ class Fixture:
(PurePath, PurePath('/a/b/c'), '/a/b/c'),
(PosixPath, PosixPath('/a/b/c'), '/a/b/c'),
(PurePosixPath, PurePosixPath('/a/b/c'), '/a/b/c'),
(os.PathLike, PurePosixPath('/a/b/c'), '/a/b/c'),
])
else:
inner_values.extend([
(Path, Path('/a/b/c'), '\\a\\b\\c'),
(PurePath, PurePath('/a/b/c'), '\\a\\b\\c'),
(WindowsPath, WindowsPath('C:/Windows'), 'C:\\Windows'),
(PureWindowsPath, PureWindowsPath('C:/Program Files'), 'C:\\Program Files'),
(os.PathLike, PureWindowsPath('/a/b/c'), '\\a\\b\\c'),
])


Expand Down

0 comments on commit 4c77ddf

Please sign in to comment.