Skip to content

Commit 48b0be1

Browse files
authored
tests: add a os.PathLike test (#410)
1 parent 60f888a commit 48b0be1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

upath/tests/implementations/test_local.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23

34
import pytest
@@ -47,3 +48,15 @@ def test_home(self):
4748
cwd = type(self.path).home()
4849
assert isinstance(cwd, LocalPath)
4950
assert cwd.path == Path.home().as_posix()
51+
52+
53+
@pytest.mark.parametrize(
54+
"protocol,path",
55+
[
56+
(None, "/tmp/somefile.txt"),
57+
("file", "file:///tmp/somefile.txt"),
58+
("local", "local:///tmp/somefile.txt"),
59+
],
60+
)
61+
def test_local_paths_are_pathlike(protocol, path):
62+
assert isinstance(UPath(path, protocol=protocol), os.PathLike)

0 commit comments

Comments
 (0)