summaryrefslogtreecommitdiff
path: root/tests/extmod/vfs_fat_fileio.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-12-02 15:37:58 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-02 15:37:58 +1100
commit6194336d81e73e74eb7e0f26501966082ce4d411 (patch)
tree62b690bd84cfd69302480235de8617c3fbbaed3f /tests/extmod/vfs_fat_fileio.py
parentf7545b200ef95632f91a9fe76394d5c19a87b280 (diff)
tests/extmod/vfs_fat_fileio: Add test for constructor of FileIO type.
Diffstat (limited to 'tests/extmod/vfs_fat_fileio.py')
-rw-r--r--tests/extmod/vfs_fat_fileio.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/extmod/vfs_fat_fileio.py b/tests/extmod/vfs_fat_fileio.py
index 4e0dc6019..f050d94e2 100644
--- a/tests/extmod/vfs_fat_fileio.py
+++ b/tests/extmod/vfs_fat_fileio.py
@@ -89,6 +89,11 @@ with vfs.open("foo_file.txt") as f2:
f2.seek(-2, 2) # SEEK_END
print(f2.read(1))
+# using constructor of FileIO type to open a file
+FileIO = type(f)
+with FileIO("foo_file.txt") as f:
+ print(f.read())
+
# dirs
vfs.mkdir("foo_dir")