tests: Use vfs module instead of os.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-11-20 23:04:55 +11:00
parent 5804aa0204
commit b87bbaeb43
34 changed files with 419 additions and 468 deletions

View File

@@ -30,7 +30,7 @@ TEST_MAPPINGS = {
# Code to allow a target MicroPython to import an .mpy from RAM
injected_import_hook_code = """\
import sys, os, io
import sys, io, vfs
class __File(io.IOBase):
def __init__(self):
self.off = 0
@@ -52,7 +52,7 @@ class __FS:
raise OSError(-2) # ENOENT
def open(self, path, mode):
return __File()
os.mount(__FS(), '/__remote')
vfs.mount(__FS(), '/__remote')
sys.path.insert(0, '/__remote')
sys.modules['{}'] = __import__('__injected')
"""