summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-06-06 13:22:51 +1000
committerDamien George <damien.p.george@gmail.com>2018-06-06 14:28:23 +1000
commit6c02da2eec02fc51c74dc6bfb9aeb34428c7a85e (patch)
tree6123551b2fdf317185daa72118abbe0926cbd74b
parent1d40f12e44afcd0ac13fd78598098298831e254e (diff)
tests/extmod: Add test for importing a script from a user VFS.
-rw-r--r--tests/extmod/vfs_fat_more.py8
-rw-r--r--tests/extmod/vfs_fat_more.py.exp1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/extmod/vfs_fat_more.py b/tests/extmod/vfs_fat_more.py
index baec96787..ae340dde8 100644
--- a/tests/extmod/vfs_fat_more.py
+++ b/tests/extmod/vfs_fat_more.py
@@ -114,3 +114,11 @@ uos.umount('/')
print(uos.getcwd())
print(uos.listdir())
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
diff --git a/tests/extmod/vfs_fat_more.py.exp b/tests/extmod/vfs_fat_more.py.exp
index aaca3cc75..24429ee09 100644
--- a/tests/extmod/vfs_fat_more.py.exp
+++ b/tests/extmod/vfs_fat_more.py.exp
@@ -26,3 +26,4 @@ mkdir OSError True
/
['sys']
[]
+test_module!