Skip to content

Commit 6c02da2

Browse files
committed
tests/extmod: Add test for importing a script from a user VFS.
1 parent 1d40f12 commit 6c02da2

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

tests/extmod/vfs_fat_more.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ def ioctl(self, op, arg):
114114
print(uos.getcwd())
115115
print(uos.listdir())
116116
print(uos.listdir('sys'))
117+
118+
# test importing a file from a mounted FS
119+
import sys
120+
sys.path.clear()
121+
sys.path.append('/sys')
122+
with open('sys/test_module.py', 'w') as f:
123+
f.write('print("test_module!")')
124+
import test_module

tests/extmod/vfs_fat_more.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ mkdir OSError True
2626
/
2727
['sys']
2828
[]
29+
test_module!

0 commit comments

Comments
 (0)