mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-23 01:53:32 +08:00
Merge 6517b60172 into 379fbd1a82
This commit is contained in:
commit
06d3504f48
@ -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),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user