tests/extmod: Add test for importing a script from a user VFS.
This commit is contained in:
parent
1d40f12e44
commit
6c02da2eec
@ -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
|
||||||
|
@ -26,3 +26,4 @@ mkdir OSError True
|
|||||||
/
|
/
|
||||||
['sys']
|
['sys']
|
||||||
[]
|
[]
|
||||||
|
test_module!
|
||||||
|
Loading…
Reference in New Issue
Block a user