Skip to content

Commit 18770d5

Browse files
committed
more tests
1 parent 20dfa94 commit 18770d5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

upath/tests/cases.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,14 @@ def test_child_path(self):
259259
assert path_a._drv == path_b._drv
260260
assert path_a._parts == path_b._parts
261261
assert path_a._url == path_b._url
262+
263+
def test_copy_path(self):
264+
path = self.path
265+
copy_path = UPath(path)
266+
267+
assert type(path) == type(copy_path)
268+
assert str(path) == str(copy_path)
269+
assert path._drv == copy_path._drv
270+
assert path._root == copy_path._root
271+
assert path._parts == copy_path._parts
272+
assert path.fs.storage_options == copy_path.fs.storage_options

upath/tests/test_core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,14 @@ def test_copy_path():
188188
assert path._root == copy_path._root
189189
assert path._parts == copy_path._parts
190190
assert path.fs.storage_options == copy_path.fs.storage_options
191+
192+
193+
def test_copy_path_posix():
194+
path = UPath("/tmp/folder", anon=True)
195+
copy_path = UPath(path)
196+
197+
assert type(path) == type(copy_path)
198+
assert str(path) == str(copy_path)
199+
assert path._drv == copy_path._drv
200+
assert path._root == copy_path._root
201+
assert path._parts == copy_path._parts

0 commit comments

Comments
 (0)