tests/extmod/vfs_fat_ramdisk: Add tests for VFS.umount()

Try to un-mount a file system and re-mount it again.
This commit is contained in:
Radomir Dopieralski 2016-08-26 15:22:53 +02:00 committed by Paul Sokolovsky
parent 26295e04ff
commit fea7fe45ea

View File

@ -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']