Jim Mussared
4216bc7d13
tests: Replace umodule with module everywhere.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2 years ago
Damien George
d99ebb310c
tests/extmod: Skip vfs tests if target doesn't have enough memory.
Signed-off-by: Damien George <damien@micropython.org>
2 years ago
Jim Mussared
8b27482692
top: Update Python formatting to black "2023 stable style".
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2 years ago
Damien George
3123f6918b
tests: Use .errno instead of .args[0] for OSError exceptions.
Signed-off-by: Damien George <damien@micropython.org>
4 years ago
Damien George
a79d97cb76
tests/extmod/vfs_fat_fileio2.py: Close test file at end of test.
Otherwise it can lead to inconsistent results running subsequent tests.
Signed-off-by: Damien George <damien@micropython.org>
4 years ago
David Lechner
3dc324d3f1
tests: Format all Python code with black, except tests in basics subdir.
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.
5 years ago
Damien George
cfe1c5abf8
extmod/vfs: Rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx.
Also rename SEC_COUNT to BLOCK_COUNT and SEC_SIZE to BLOCK_SIZE.
5 years ago
Damien George
5ef0d2ab14
tests/extmod: Remove conditional import of uos_vfs, it no longer exists.
This conditional import was only used to get the tests working on the unix
coverage build, which has now switched to use VFS by default so the uos
module alone has the required functionality.
7 years ago
Paul Sokolovsky
85d809d1f4
tests: Convert remaining "sys.exit()" to "raise SystemExit".
8 years ago
Damien George
852c215d76
tests/extmod/vfs: Update tests to reflect new ilistdir() method.
8 years ago
Paul Sokolovsky
499ea8b253
tests/extmod/vfs_fat_fileio*: Improve skippability.
Should be skipped on missing uso, uerrno modules.
8 years ago
Paul Sokolovsky
b9e9cfcfc1
tests: vfs_fat_fileio.py is too big to be parsed in 16K heap, split in 2.
This restores ability to run testsuite with 16K heap.
8 years ago
Damien George
b9bfaa349a
tests/extmod/vfs_fat: Update tests to work with new VFS sub-system.
The vfs_fat_fsusermount test is no longer relevant so has been removed.
8 years ago
Damien George
94d87fbb30
test/extmod: Update vfs_fat tests for new OO FatFs library.
The new version of FatFs requires a minimum of 50 blocks on the device.
Also, some tests no longer make sense with an OO vfs.
8 years ago
Damien George
6194336d81
tests/extmod/vfs_fat_fileio: Add test for constructor of FileIO type.
8 years ago
Damien George
b7df3e541a
extmod/vfs_fat: Implement POSIX behaviour of rename, allow to overwrite.
If the destination of os.rename() exists then it will be overwritten if it
is a file. This is the POSIX behaviour, which is also the CPython
behaviour, and so we follow suit.
See issue #2598 for discussion.
8 years ago
Damien George
5694201930
extmod/vfs_fat_file: Make file.close() a no-op if file already closed.
As per CPython semantics. In particular, file.__del__() should not raise
an exception if the file is already closed.
8 years ago
Alex March
cb20d999bc
tests/extmod/vfs_fat: Improve VFS test coverage.
Covered case:
- Stat cases
- Invalid read/write/flush/close
- Invalid mkdir/rmdir/remove/getcwd
- File seek/tell, modes a/x/+, t/b
- Writing to a full disk
- Full path rename, slash trim
- Rename cases
- Bytestring listdir
- File object printing
8 years ago