(tmp_dir, scm, dvc)
| 907 | |
| 908 | |
| 909 | def test_ls_tree_maxdepth(tmp_dir, scm, dvc): |
| 910 | tmp_dir.scm_gen(FS_STRUCTURE, commit="init") |
| 911 | tmp_dir.dvc_gen(DVC_STRUCTURE, commit="dvc") |
| 912 | |
| 913 | files = ls_tree(os.fspath(tmp_dir), maxdepth=0) |
| 914 | assert _simplify_tree(files) == {".": None} |
| 915 | |
| 916 | files = ls_tree(os.fspath(tmp_dir), maxdepth=1) |
| 917 | assert _simplify_tree(files) == { |
| 918 | ".": { |
| 919 | ".dvcignore": None, |
| 920 | ".gitignore": None, |
| 921 | "README.md": None, |
| 922 | "data": None, |
| 923 | "model": None, |
| 924 | "structure.xml": None, |
| 925 | "structure.xml.dvc": None, |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | files = ls_tree(os.fspath(tmp_dir), maxdepth=2) |
| 930 | assert _simplify_tree(files) == { |
| 931 | ".": { |
| 932 | ".dvcignore": None, |
| 933 | ".gitignore": None, |
| 934 | "README.md": None, |
| 935 | "data": {"subcontent": None}, |
| 936 | "model": { |
| 937 | ".gitignore": None, |
| 938 | "people.csv": None, |
| 939 | "people.csv.dvc": None, |
| 940 | "script.py": None, |
| 941 | "train.py": None, |
| 942 | }, |
| 943 | "structure.xml": None, |
| 944 | "structure.xml.dvc": None, |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | files = ls_tree(os.fspath(tmp_dir), maxdepth=3) |
| 949 | assert _simplify_tree(files) == { |
| 950 | ".": { |
| 951 | ".dvcignore": None, |
| 952 | ".gitignore": None, |
| 953 | "README.md": None, |
| 954 | "data": { |
| 955 | "subcontent": { |
| 956 | ".gitignore": None, |
| 957 | "data.xml": None, |
| 958 | "data.xml.dvc": None, |
| 959 | "statistics": None, |
| 960 | } |
| 961 | }, |
| 962 | "model": { |
| 963 | ".gitignore": None, |
| 964 | "people.csv": None, |
| 965 | "people.csv.dvc": None, |
| 966 | "script.py": None, |
nothing calls this directly
no test coverage detected