This commit is contained in:
Luke Mino-Altherr 2026-03-17 01:46:32 -04:00 committed by GitHub
commit 06d3504f48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -28,8 +28,8 @@ def get_file_info(path: str, relative_to: str) -> FileInfo:
return { return {
"path": os.path.relpath(path, relative_to).replace(os.sep, '/'), "path": os.path.relpath(path, relative_to).replace(os.sep, '/'),
"size": os.path.getsize(path), "size": os.path.getsize(path),
"modified": os.path.getmtime(path), "modified": int(os.path.getmtime(path) * 1000),
"created": os.path.getctime(path) "created": int(os.path.getctime(path) * 1000),
} }

View File

@ -69,7 +69,11 @@ async def test_listuserdata_full_info(aiohttp_client, app, tmp_path):
assert len(result) == 1 assert len(result) == 1
assert result[0]["path"] == "file1.txt" assert result[0]["path"] == "file1.txt"
assert "size" in result[0] assert "size" in result[0]
assert "modified" in result[0] assert isinstance(result[0]["modified"], int)
assert isinstance(result[0]["created"], int)
# Verify millisecond magnitude (timestamps after year 2000 in ms are > 946684800000)
assert result[0]["modified"] > 946684800000
assert result[0]["created"] > 946684800000
async def test_listuserdata_split_path(aiohttp_client, app, tmp_path): async def test_listuserdata_split_path(aiohttp_client, app, tmp_path):