diff options
| author | Damien George <damien.p.george@gmail.com> | 2016-12-02 15:37:58 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2016-12-02 15:37:58 +1100 |
| commit | 6194336d81e73e74eb7e0f26501966082ce4d411 (patch) | |
| tree | 62b690bd84cfd69302480235de8617c3fbbaed3f | |
| parent | f7545b200ef95632f91a9fe76394d5c19a87b280 (diff) | |
tests/extmod/vfs_fat_fileio: Add test for constructor of FileIO type.
| -rw-r--r-- | tests/extmod/vfs_fat_fileio.py | 5 | ||||
| -rw-r--r-- | tests/extmod/vfs_fat_fileio.py.exp | 1 |
2 files changed, 6 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") diff --git a/tests/extmod/vfs_fat_fileio.py.exp b/tests/extmod/vfs_fat_fileio.py.exp index 4e34e83a8..a09442ae8 100644 --- a/tests/extmod/vfs_fat_fileio.py.exp +++ b/tests/extmod/vfs_fat_fileio.py.exp @@ -9,6 +9,7 @@ h e True d +hello!world! True True True |
