summaryrefslogtreecommitdiff
path: root/tests/extmod/vfs_lfs.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/vfs_lfs.py')
-rw-r--r--tests/extmod/vfs_lfs.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/extmod/vfs_lfs.py b/tests/extmod/vfs_lfs.py
index 609d9f949..8e56400df 100644
--- a/tests/extmod/vfs_lfs.py
+++ b/tests/extmod/vfs_lfs.py
@@ -35,6 +35,11 @@ class RAMBlockDevice:
return 0
+def print_stat(st, print_size=True):
+ # don't print times (just check that they have the correct type)
+ print(st[:6], st[6] if print_size else -1, type(st[7]), type(st[8]), type(st[9]))
+
+
def test(bdev, vfs_class):
print("test", vfs_class)
@@ -69,10 +74,10 @@ def test(bdev, vfs_class):
vfs.mkdir("testdir")
# stat a file
- print(vfs.stat("test"))
+ print_stat(vfs.stat("test"))
# stat a dir (size seems to vary on LFS2 so don't print that)
- print(vfs.stat("testdir")[:6])
+ print_stat(vfs.stat("testdir"), False)
# read
with vfs.open("test", "r") as f:
@@ -112,8 +117,8 @@ def test(bdev, vfs_class):
# create file in directory to make sure paths are relative
vfs.open("test2", "w").close()
- print(vfs.stat("test2"))
- print(vfs.stat("/testdir/test2"))
+ print_stat(vfs.stat("test2"))
+ print_stat(vfs.stat("/testdir/test2"))
vfs.remove("test2")
# chdir back to root and remove testdir