Skip to content

Commit fea7fe4

Browse files
deshipupfalcon
authored andcommitted
tests/extmod/vfs_fat_ramdisk: Add tests for VFS.umount()
Try to un-mount a file system and re-mount it again.
1 parent 26295e0 commit fea7fe4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/extmod/vfs_fat_ramdisk.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
import uos
3+
import uerrno
34
try:
45
uos.VfsFat
56
except AttributeError:
@@ -84,3 +85,15 @@ def ioctl(self, op, arg):
8485

8586
vfs.chdir("..")
8687
print("getcwd:", vfs.getcwd())
88+
89+
90+
vfs.umount()
91+
try:
92+
vfs.listdir()
93+
except OSError as e:
94+
assert e.args[0] == uerrno.ENODEV
95+
else:
96+
raise AssertionError("expected OSError not thrown")
97+
98+
vfs = uos.VfsFat(bdev, "/ramdisk")
99+
assert vfs.listdir() == ['foo_dir', 'moved-to-root.txt']

0 commit comments

Comments
 (0)