diff options
author | robert <robert@hammelrath.com> | 2020-05-04 15:34:12 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-05-08 21:54:04 +1000 |
commit | 0f83ef395cccaa771543450ff8a4200da108e3d6 (patch) | |
tree | a14282153da432c19de0d7074f54a3fd64bbf154 /tests/extmod/vfs_lfs.py | |
parent | d3ea28d04a7df9ca536a9002c8fda2f6e3a88f09 (diff) | |
download | micropython-0f83ef395cccaa771543450ff8a4200da108e3d6.tar.gz micropython-0f83ef395cccaa771543450ff8a4200da108e3d6.zip |
extmod/vfs_lfsx: Fix rename to respect cur dir for new path.
If the new name start with '/', cur_dir is not prepened any more, so that
the current working directory is respected. And extend the test cases for
rename to cover this functionality.
Diffstat (limited to 'tests/extmod/vfs_lfs.py')
-rw-r--r-- | tests/extmod/vfs_lfs.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/extmod/vfs_lfs.py b/tests/extmod/vfs_lfs.py index 82c8fead5a..609d9f949e 100644 --- a/tests/extmod/vfs_lfs.py +++ b/tests/extmod/vfs_lfs.py @@ -63,7 +63,7 @@ def test(bdev, vfs_class): # mkdir, rmdir vfs.mkdir("testdir") print(list(vfs.ilistdir())) - print(list(vfs.ilistdir("testdir"))) + print(sorted(list(vfs.ilistdir("testdir")))) vfs.rmdir("testdir") print(list(vfs.ilistdir())) vfs.mkdir("testdir") @@ -91,11 +91,17 @@ def test(bdev, vfs_class): # rename vfs.rename("testbig", "testbig2") - print(list(vfs.ilistdir())) + print(sorted(list(vfs.ilistdir()))) + vfs.chdir("testdir") + vfs.rename("/testbig2", "testbig2") + print(sorted(list(vfs.ilistdir()))) + vfs.rename("testbig2", "/testbig2") + vfs.chdir("/") + print(sorted(list(vfs.ilistdir()))) # remove vfs.remove("testbig2") - print(list(vfs.ilistdir())) + print(sorted(list(vfs.ilistdir()))) # getcwd, chdir vfs.mkdir("/testdir2") |