def test_prep_ls(aaa): """I want to get a simple list of files and folders separated by type""" prep_folder() aaa.user_is_anonymous = True ls = t.prep_ls("/tmp/test", details=False) del_folder() assert ls == {"files": ["file"], "dirs": ["folder"]}
def test_prep_ls_details(aaa): """I want to get a list of files and folders separated by type with details about the folder: - name, size, mtime """ prep_folder() aaa.user_is_anonymous = True ls = t.prep_ls("/tmp/test", details=True) del_folder() assert {"name", "size", "mtime"} == set(ls["dirs"][0].keys()) assert {"name", "size", "mtime"} == set(ls["files"][0].keys())