summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-03-11 14:39:41 +1100
committerDamien George <damien@micropython.org>2025-03-27 17:04:12 +1100
commite4051a1ca66703090383678a1747c3f99e993309 (patch)
tree05b0ece8c55b373a4fb561c676beb389012e10c3 /tests
parentc68a40ac94ea8a8dd6031dff6f21706977893bef (diff)
extmod/vfs_rom: Implement minimal VfsRom.getcwd() method.
This is needed if you chdir to a ROMFS and want to query your current directory. Prior to this change, using `os.getcwd()` when in a ROMFS would raise: AttributeError: 'VfsRom' object has no attribute 'getcwd' Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/vfs_rom.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/extmod/vfs_rom.py b/tests/extmod/vfs_rom.py
index dc88481c0..770b6863b 100644
--- a/tests/extmod/vfs_rom.py
+++ b/tests/extmod/vfs_rom.py
@@ -408,9 +408,11 @@ class TestMounted(TestBase):
def test_chdir(self):
os.chdir("/test_rom")
+ self.assertEqual(os.getcwd(), "/test_rom")
self.assertEqual(os.listdir(), self.romfs_listdir)
os.chdir("/test_rom/")
+ self.assertEqual(os.getcwd(), "/test_rom")
self.assertEqual(os.listdir(), self.romfs_listdir)
# chdir within the romfs is not implemented.