diff options
author | Damien George <damien.p.george@gmail.com> | 2017-05-13 19:10:15 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-05-13 19:10:15 +1000 |
commit | cda09727b451b6b928cc0129c4be7d3127f1aaad (patch) | |
tree | 24812b6967f7eae816be84a7599165811b204f01 | |
parent | f95e4e77823919dfe82b6711f1d25d2d8c5008fc (diff) | |
download | micropython-cda09727b451b6b928cc0129c4be7d3127f1aaad.tar.gz micropython-cda09727b451b6b928cc0129c4be7d3127f1aaad.zip |
tests/extmod/vfs_fat: Add test for ilistdir of a non-existent directory.
-rw-r--r-- | tests/extmod/vfs_fat_ramdisk.py | 6 | ||||
-rw-r--r-- | tests/extmod/vfs_fat_ramdisk.py.exp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/extmod/vfs_fat_ramdisk.py b/tests/extmod/vfs_fat_ramdisk.py index 89b40e3a24..fe72a8beff 100644 --- a/tests/extmod/vfs_fat_ramdisk.py +++ b/tests/extmod/vfs_fat_ramdisk.py @@ -93,3 +93,9 @@ uos.umount(vfs) vfs = uos.VfsFat(bdev) print(list(vfs.ilistdir(b""))) + +# list a non-existent directory +try: + vfs.ilistdir(b"no_exist") +except OSError as e: + print('ENOENT:', e.args[0] == uerrno.ENOENT) diff --git a/tests/extmod/vfs_fat_ramdisk.py.exp b/tests/extmod/vfs_fat_ramdisk.py.exp index 6298a7efdc..ccd0f7134c 100644 --- a/tests/extmod/vfs_fat_ramdisk.py.exp +++ b/tests/extmod/vfs_fat_ramdisk.py.exp @@ -13,3 +13,4 @@ getcwd: /foo_dir True getcwd: / [(b'foo_file.txt', 32768, 0), (b'foo_dir', 16384, 0)] +ENOENT: True |