MCPcopy
hub / github.com/treeverse/dvc / test_fs_ls_tree

Function test_fs_ls_tree

tests/func/test_ls.py:1005–1031  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1003
1004
1005def test_fs_ls_tree():
1006 fs = MemoryFileSystem(global_store=False)
1007 fs.pipe({f: content.encode() for f, content in FS_STRUCTURE.items()})
1008 root = fs.root_marker
1009
1010 files = _ls_tree(fs, "README.md")
1011 assert _simplify_tree(files) == {"README.md": None}
1012 files = _ls_tree(fs, root)
1013 expected = {
1014 root: {
1015 ".gitignore": None,
1016 "README.md": None,
1017 "model": {
1018 "script.py": None,
1019 "train.py": None,
1020 },
1021 }
1022 }
1023 assert _simplify_tree(files) == expected
1024
1025 files = _ls_tree(fs, "model")
1026 assert _simplify_tree(files) == {
1027 "model": {
1028 "script.py": None,
1029 "train.py": None,
1030 }
1031 }
1032
1033
1034def test_fs_ls_tree_maxdepth():

Callers

nothing calls this directly

Calls 3

_ls_treeFunction · 0.90
_simplify_treeFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected