You've already forked onec_codetemplate_parser
mirror of
https://github.com/240596448/onec_codetemplate_parser.git
synced 2025-11-23 21:34:39 +02:00
repo, ref core
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from onec_codetemplate_parser import core
|
||||
from tests.common import check_files_sequential, folder_is_empty, folder_contains_files
|
||||
from onec_codetemplate_parser import core, repository
|
||||
from tests.common import check_files_sequential
|
||||
|
||||
class TestReadSkobkofile:
|
||||
|
||||
@@ -25,17 +25,20 @@ class TestWriteToFiles:
|
||||
|
||||
def test_white_to_src(self, test_data, temp_src):
|
||||
root = core.parser(test_data)
|
||||
root.to_files(temp_src)
|
||||
root.to_src(temp_src)
|
||||
|
||||
# TODO: добавить разные проверки для каждого файла
|
||||
|
||||
# assert folder_contains_files(temp_src), f"В папке нет ни одного файла {temp_src}"
|
||||
# assert not folder_is_empty(temp_src), f"Папка src пустая {temp_src}"
|
||||
|
||||
# Проверка: есть ли папки
|
||||
dirs = [p for p in temp_src.iterdir() if p.is_dir()]
|
||||
assert len(dirs) == 1, f"Ожидалась 1 папка в src, получили {len(dirs)}"
|
||||
assert temp_src / "001.0_Надулич" in dirs, f"Папка 001.0_Надулич не найдена в {temp_src}"
|
||||
# dirs = [p for p in temp_src.iterdir() if p.is_dir()]
|
||||
# assert len(dirs) == 1, f"Ожидалась 1 папка в src, получили {len(dirs)}"
|
||||
# assert temp_src / "001.0_Надулич" in dirs, f"Папка 001.0_Надулич не найдена в {temp_src}"
|
||||
|
||||
def test_sequential_name(self, temp_src):
|
||||
d = temp_src / "001.0_Надулич" / "002.0_Комментарии"
|
||||
subfiles = [p.name for p in d.iterdir()]
|
||||
check_files_sequential(subfiles)
|
||||
if d.exists():
|
||||
subfiles = list(p.name for p in repository.dir_items(d))
|
||||
check_files_sequential(subfiles)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user