From 6a3d70db9642e29b017f111abaf7fb6238a9b5a6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 28 Nov 2020 12:21:40 +1100 Subject: [PATCH] tests/extmod: Add vfs_posix.py test for uos.VfsPosix class. Signed-off-by: Damien George --- tests/extmod/vfs_posix.py | 23 +++++++++++++++++++++++ tests/extmod/vfs_posix.py.exp | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 tests/extmod/vfs_posix.py create mode 100644 tests/extmod/vfs_posix.py.exp diff --git a/tests/extmod/vfs_posix.py b/tests/extmod/vfs_posix.py new file mode 100644 index 0000000000..3bea99365d --- /dev/null +++ b/tests/extmod/vfs_posix.py @@ -0,0 +1,23 @@ +# Test for VfsPosix + +try: + import uos + + uos.VfsPosix +except (ImportError, AttributeError): + print("SKIP") + raise SystemExit + + +# getcwd and chdir +curdir = uos.getcwd() +uos.chdir("/") +print(uos.getcwd()) +uos.chdir(curdir) +print(uos.getcwd() == curdir) + +# stat +print(type(uos.stat("/"))) + +# listdir and ilistdir +print(type(uos.listdir("/"))) diff --git a/tests/extmod/vfs_posix.py.exp b/tests/extmod/vfs_posix.py.exp new file mode 100644 index 0000000000..1b1f59b43e --- /dev/null +++ b/tests/extmod/vfs_posix.py.exp @@ -0,0 +1,4 @@ +/ +True + +