Skip to content

Commit cda0972

Browse files
committed
tests/extmod/vfs_fat: Add test for ilistdir of a non-existent directory.
1 parent f95e4e7 commit cda0972

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/extmod/vfs_fat_ramdisk.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,9 @@ def ioctl(self, op, arg):
9393

9494
vfs = uos.VfsFat(bdev)
9595
print(list(vfs.ilistdir(b"")))
96+
97+
# list a non-existent directory
98+
try:
99+
vfs.ilistdir(b"no_exist")
100+
except OSError as e:
101+
print('ENOENT:', e.args[0] == uerrno.ENOENT)

tests/extmod/vfs_fat_ramdisk.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ getcwd: /foo_dir
1313
True
1414
getcwd: /
1515
[(b'foo_file.txt', 32768, 0), (b'foo_dir', 16384, 0)]
16+
ENOENT: True

0 commit comments

Comments
 (0)