summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2018-03-27 21:28:18 -0500
committerJeff Epler <jepler@gmail.com>2018-03-27 21:28:18 -0500
commitfe7f405fc7708cdbe426e2f255b01a1a77e574d9 (patch)
tree6cce12b5fba96950cff1a14ab6a687349d9bd153 /tests
parentc08f5a3a0071dd1940a09c6b5f0bdd8e4768c7f0 (diff)
Add VfsFat.label property
These allow accessing the filesystem label. For instance, in boot.py, you can set the label on the built-in storage with: storage.remount('/', False) storage.getmount('/').label = "NEWLABEL" storage.remount('/', True) Users with multiple CIRCUITPY boards may find it desirable to choose a different label for each board they own.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/vfs_fat_ramdisk.py2
-rw-r--r--tests/extmod/vfs_fat_ramdisk.py.exp1
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/extmod/vfs_fat_ramdisk.py b/tests/extmod/vfs_fat_ramdisk.py
index 801c69786..896641ab3 100644
--- a/tests/extmod/vfs_fat_ramdisk.py
+++ b/tests/extmod/vfs_fat_ramdisk.py
@@ -54,6 +54,8 @@ print(b"hello!" not in bdev.data)
vfs = uos.VfsFat(bdev)
uos.mount(vfs, "/ramdisk")
+vfs.label = 'label test'
+print("label:", vfs.label)
print("statvfs:", vfs.statvfs("/ramdisk"))
print("getcwd:", vfs.getcwd())
diff --git a/tests/extmod/vfs_fat_ramdisk.py.exp b/tests/extmod/vfs_fat_ramdisk.py.exp
index ccd0f7134..a3c3470a9 100644
--- a/tests/extmod/vfs_fat_ramdisk.py.exp
+++ b/tests/extmod/vfs_fat_ramdisk.py.exp
@@ -1,5 +1,6 @@
True
True
+label: LABEL TEST
statvfs: (512, 512, 16, 16, 16, 0, 0, 0, 0, 255)
getcwd: /
True