diff --git a/tiledb/tests/test_vfs.py b/tiledb/tests/test_vfs.py index c232438616..5559cb3f8b 100644 --- a/tiledb/tests/test_vfs.py +++ b/tiledb/tests/test_vfs.py @@ -346,8 +346,10 @@ def test_ls_recursive(self): set(expected), set( map( - # keep only the part after basepath - lambda x: x.split(basepath)[1][1:], + # # Keep only the paths after the basepath and normalize them to work on all platforms + lambda x: os.path.normpath( + x.split("test_vfs_ls_recursive/")[1] + ).replace("\\", "/"), self.vfs.ls_recursive(basepath), ) ), @@ -366,8 +368,10 @@ def callback(uri, _): # we don't use the second argument 'is_dir' set(expected), set( map( - # keep only the part after basepath - lambda x: x.split(basepath)[1][1:], + # Keep only the paths after the basepath and normalize them to work on all platforms + lambda x: os.path.normpath( + x.split("test_vfs_ls_recursive/")[1] + ).replace("\\", "/"), callback_results, ) ), @@ -378,8 +382,10 @@ def callback(uri, _): # we don't use the second argument 'is_dir' set(expected), set( map( - # keep only the part after basepath - lambda x: x.split(basepath)[1][1:], + # Keep only the paths after the basepath and normalize them to work on all platforms + lambda x: os.path.normpath( + x.split("test_vfs_ls_recursive/")[1] + ).replace("\\", "/"), self.vfs.ls(basepath, recursive=True), ) ),