summaryrefslogtreecommitdiff
path: root/tests/extmod/vfs_userfs.py
AgeCommit message (Collapse)Author
2024-02-07tests: Use vfs module instead of os.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-11-09extmod/vfs_reader: Add file ioctl to set read buffer size.Andrew Leech
Can be used to speed up importing a file from a vfs based filesystem. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2023-09-14py/persistentcode: Always close reader even if an exception is raised.Damien George
Fixes issue #3874. Signed-off-by: Damien George <damien@micropython.org>
2023-09-14py/parse: Always free lexer even if an exception is raised.Damien George
Fixes issue #3843. Signed-off-by: Damien George <damien@micropython.org>
2023-06-08tests: Replace umodule with module everywhere.Jim Mussared
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-09-04all: Rename "sys" module to "usys".stijn
This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".
2020-08-12extmod/vfs_reader: Fix mp_reader_new_file to open file in "rb" mode.Damien George
mp_reader_new_file() is used to read in files for importing, either .py or .mpy files, for the lexer and persistent code loader respectively. In both cases the file should be opened in raw bytes mode: the lexer handles unicode characters itself, and .mpy files contain 8-bit bytes by nature. Before this commit importing was working correctly because, although the file was opened in text mode, all native filesystem implementations (POSIX, FAT, LFS) would access the file in raw bytes mode via mp_stream_rw() calling mp_stream_p_t.read(). So it was only an issue for non-native filesystems, such as those implemented in Python. For Python-based filesystem implementations, a call to mp_stream_rw() would go via IOBase and then to readinto() at the Python level, and readinto() is only defined on files opened in raw bytes mode. Signed-off-by: Damien George <damien@micropython.org>
2020-03-30tests: Format all Python code with black, except tests in basics subdir.David Lechner
This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting.
2018-07-20tests: Improve feature detection for VFS.Ayke van Laethem
2018-06-12tests/extmod: Add test for VFS and user-defined filesystem and files.Damien George