()
| 1032 | |
| 1033 | |
| 1034 | def test_fs_ls_tree_maxdepth(): |
| 1035 | fs = MemoryFileSystem(global_store=False) |
| 1036 | fs.pipe({f: content.encode() for f, content in FS_STRUCTURE.items()}) |
| 1037 | |
| 1038 | files = _ls_tree(fs, "/", maxdepth=0) |
| 1039 | assert _simplify_tree(files) == {"/": None} |
| 1040 | |
| 1041 | files = _ls_tree(fs, "/", maxdepth=1) |
| 1042 | assert _simplify_tree(files) == { |
| 1043 | "/": { |
| 1044 | ".gitignore": None, |
| 1045 | "README.md": None, |
| 1046 | "model": None, |
| 1047 | } |
| 1048 | } |
| 1049 | |
| 1050 | files = _ls_tree(fs, "/", maxdepth=2) |
| 1051 | assert _simplify_tree(files) == { |
| 1052 | "/": { |
| 1053 | ".gitignore": None, |
| 1054 | "README.md": None, |
| 1055 | "model": { |
| 1056 | "script.py": None, |
| 1057 | "train.py": None, |
| 1058 | }, |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | files = _ls_tree(fs, "README.md", maxdepth=3) |
| 1063 | assert _simplify_tree(files) == {"README.md": None} |
nothing calls this directly
no test coverage detected