diff options
Diffstat (limited to 'tests/extmod/vfs_lfs_mount.py')
| -rw-r--r-- | tests/extmod/vfs_lfs_mount.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/extmod/vfs_lfs_mount.py b/tests/extmod/vfs_lfs_mount.py index 2c40b2989..3d8cec607 100644 --- a/tests/extmod/vfs_lfs_mount.py +++ b/tests/extmod/vfs_lfs_mount.py @@ -67,6 +67,23 @@ def test(bdev, vfs_class): # umount uos.umount("/lfs") + # mount read-only + vfs = vfs_class(bdev) + uos.mount(vfs, "/lfs", readonly=True) + + # test reading works + with open("/lfs/subdir/lfsmod2.py") as f: + print("lfsmod2.py:", f.read()) + + # test writing fails + try: + open("/lfs/test_write", "w") + except OSError as er: + print(repr(er)) + + # umount + uos.umount("/lfs") + # clear imported modules usys.modules.clear() |
