Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add st_birthtime as standard field #254

Merged
merged 5 commits into from
Aug 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for stat time values
  • Loading branch information
Thomas H authored and Thomas H committed Aug 23, 2024
commit 3e019835b0c1218afcf977aff33e17bc5229aff0
26 changes: 23 additions & 3 deletions upath/tests/test_stat.py
Original file line number Diff line number Diff line change
@@ -25,15 +25,35 @@ def test_stat_as_info(pth_file):


def test_stat_atime(pth_file):
assert isinstance(pth_file.stat().st_atime, (float, int))
atime = pth_file.stat().st_atime
assert isinstance(atime, (float, int))


@pytest.mark.xfail(reason="fsspec does not return 'atime'")
def test_stat_atime_value(pth_file):
atime = pth_file.stat().st_atime
assert atime > 0


def test_stat_mtime(pth_file):
assert isinstance(pth_file.stat().st_mtime, (float, int))
mtime = pth_file.stat().st_mtime
assert isinstance(mtime, (float, int))


def test_stat_mtime_value(pth_file):
mtime = pth_file.stat().st_mtime
assert mtime > 0


def test_stat_ctime(pth_file):
assert isinstance(pth_file.stat().st_ctime, (float, int))
ctime = pth_file.stat().st_ctime
assert isinstance(ctime, (float, int))


@pytest.mark.xfail(reason="fsspec returns 'created' but not 'ctime'")
def test_stat_ctime_value(pth_file):
ctime = pth_file.stat().st_ctime
assert ctime > 0


def test_stat_seq_interface(pth_file):