tests/extmod: Add test for importing a script from a user VFS.

This commit is contained in:
Damien George 2018-06-06 13:22:51 +10:00
parent 1d40f12e44
commit 6c02da2eec
2 changed files with 9 additions and 0 deletions

View File

@ -114,3 +114,11 @@ uos.umount('/')
print(uos.getcwd()) print(uos.getcwd())
print(uos.listdir()) print(uos.listdir())
print(uos.listdir('sys')) print(uos.listdir('sys'))
# test importing a file from a mounted FS
import sys
sys.path.clear()
sys.path.append('/sys')
with open('sys/test_module.py', 'w') as f:
f.write('print("test_module!")')
import test_module

View File

@ -26,3 +26,4 @@ mkdir OSError True
/ /
['sys'] ['sys']
[] []
test_module!