1
0
mirror of https://github.com/240596448/onec_codetemplate_parser.git synced 2025-11-23 21:34:39 +02:00
This commit is contained in:
Vladimir Nadulich
2025-10-21 22:33:34 +03:00
commit fd3af97957
9 changed files with 439 additions and 0 deletions

30
tests/conftest.py Normal file
View File

@@ -0,0 +1,30 @@
import pytest
from onec_codetemplate_parser import main
from pathlib import Path
TEST_FILE = 'Documents/1C/1c-text-tempates/Надулич.st'
@pytest.fixture(scope="class")
def test_file_path():
return Path.home() / TEST_FILE
@pytest.fixture(scope="class")
def test_data(test_file_path):
file_data = test_file_path.read_text(encoding='utf-8-sig')
return file_data
@pytest.fixture(scope="class")
def temp_src(tmp_path_factory):
"""
Создаёт временную папку 'src' для теста.
Папка автоматически удаляется после теста.
"""
return tmp_path_factory.mktemp("src")
@pytest.fixture(scope="class")
def temp_src2(tmp_path_factory):
"""
Создаёт временную папку 'src' для теста.
Папка автоматически удаляется после теста.
"""
return tmp_path_factory.mktemp("src2")