summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2016-08-26 15:22:53 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-08-26 23:24:32 +0300
commitfea7fe45ea4145fff7afc2f07f461613ad31e781 (patch)
tree52e60609002f888c119effe5492f8dee039054fb
parent26295e04ff878d821ff4fbb9a5d8176906907da5 (diff)
downloadmicropython-fea7fe45ea4145fff7afc2f07f461613ad31e781.tar.gz
micropython-fea7fe45ea4145fff7afc2f07f461613ad31e781.zip
tests/extmod/vfs_fat_ramdisk: Add tests for VFS.umount()
Try to un-mount a file system and re-mount it again.
-rw-r--r--tests/extmod/vfs_fat_ramdisk.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/extmod/vfs_fat_ramdisk.py b/tests/extmod/vfs_fat_ramdisk.py
index 7860d68124..57c8eeba89 100644
--- a/tests/extmod/vfs_fat_ramdisk.py
+++ b/tests/extmod/vfs_fat_ramdisk.py
@@ -1,5 +1,6 @@
import sys
import uos
+import uerrno
try:
uos.VfsFat
except AttributeError:
@@ -84,3 +85,15 @@ assert vfs.listdir() == ["sub_file.txt"]
vfs.chdir("..")
print("getcwd:", vfs.getcwd())
+
+
+vfs.umount()
+try:
+ vfs.listdir()
+except OSError as e:
+ assert e.args[0] == uerrno.ENODEV
+else:
+ raise AssertionError("expected OSError not thrown")
+
+vfs = uos.VfsFat(bdev, "/ramdisk")
+assert vfs.listdir() == ['foo_dir', 'moved-to-root.txt']