-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix option inheritance in create_path and add tests (#617)
fix and test create_path
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from lamindb_setup.dev.upath import UPath, create_path | ||
|
||
|
||
def test_create_path(): | ||
upath = UPath("s3://lndb-setup-ci/xyz/", default_fill_cache=False) | ||
assert "default_fill_cache" in upath._kwargs | ||
|
||
upath = create_path(upath) | ||
# test option inheritance | ||
assert "default_fill_cache" in upath._kwargs | ||
# test cache_regions setting for s3 | ||
assert "cache_regions" in upath._kwargs | ||
# test removal of training slash | ||
assert upath.as_posix()[-1] != "/" | ||
assert ( | ||
UPath("s3://lndb-setup-ci/xyz").as_posix() | ||
== create_path("s3://lndb-setup-ci/xyz/").as_posix() | ||
) |