def test_get_all_files_success(): filesystem = FileSystem() folder = helper.populate_folder(5) files = filesystem.get_all_files(folder) shutil.rmtree(folder) length = len(files) assert length == 5, length
def test_get_all_files_by_extension(): filesystem = FileSystem() folder = helper.populate_folder(5) files = filesystem.get_all_files(folder) length = len(files) assert length == 5, length files = filesystem.get_all_files(folder, 'jpg') length = len(files) assert length == 3, length files = filesystem.get_all_files(folder, 'txt') length = len(files) assert length == 2, length files = filesystem.get_all_files(folder, 'gif') length = len(files) assert length == 0, length shutil.rmtree(folder)