We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fffa14a commit 16b0218Copy full SHA for 16b0218
upath/tests/test_core.py
@@ -97,3 +97,14 @@ class TestFSSpecLocal(BaseTests):
97
def path(self, local_testdir):
98
path = f"file://{local_testdir}"
99
self.path = UPath(path)
100
+
101
102
+def test_create_from_type(local_testdir):
103
+ paths = [local_testdir, "s3://bucket/folder", "gs://bucket/folder"]
104
+ for path in paths:
105
+ parts = path.split("/")
106
+ parent = "/".join(parts[:-1])
107
+ upath = UPath(path)
108
+ cast = type(upath)
109
+ new = cast(parent)
110
+ assert isinstance(new, cast)
0 commit comments