+def add_nested_folders_in_rst_set(file_names, path):
+ """Add RST files from folders where are only folders without tests.
+
+ :param file_names: List of all files to be documented with path beginning
+ in the working directory.
+ :param path: Path where it starts adding missing RST files.
+ :type file_names: list
+ :type path: str
+ """
+
+ # When we split directory tree by "/" we don't need to create RST file in
+ # folders in depth <= 5. It's because the WORKING_DIR folder structure i
+ # as following:
+ # /tmp/tmp-csitXXX/tests/<subject_of_test>/<type_of_test>/<what_is_tested>
+ # That splits to ie:
+ # ['', 'tmp', 'tmp-csitXXX', 'tests', 'vpp', 'device', 'container_memif']
+ # We need to generate RST files for folders after <subject_of_test> which
+ # is in depth > 5
+
+ for directory in fast_scandir(path):
+ dir_list = directory.split(u"/")
+ if len(dir_list) > 5:
+ # cut ['', 'tmp', 'tmp-csitXXX']
+ dir_rst = u".".join(dir_list[3:]) + u".rst"
+ if dir_rst not in file_names and u"__pycache__" not in dir_rst:
+ file_names.add(dir_rst)
+
+