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
dataset
This commit is contained in:
@@ -159,7 +159,7 @@ class Root(Node):
|
||||
for child in self.children:
|
||||
parts.append(",\n")
|
||||
parts.append(child.compile())
|
||||
parts.append("\n}")
|
||||
parts.append("\n}" if self.children else "}")
|
||||
return "".join(parts)
|
||||
|
||||
def to_files(self, path):
|
||||
|
||||
@@ -2,12 +2,28 @@
|
||||
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
import os
|
||||
|
||||
TEST_FILE = 'Documents/1C/1c-code-templates/Надулич.st'
|
||||
|
||||
@pytest.fixture(scope="class", name="test_file_path")
|
||||
def test_data_path():
|
||||
return Path.home() / TEST_FILE
|
||||
def get_all_test_files():
|
||||
"""Автоматически находим все файлы в директории"""
|
||||
st_files = Path(__file__).parent.glob("data/*.st")
|
||||
list_st_files = [f for f in st_files if f.is_file()]
|
||||
|
||||
list_st_files.append(Path.home()/TEST_FILE)
|
||||
|
||||
env_st_templates = os.getenv("ST_TEMPLATES")
|
||||
if env_st_templates:
|
||||
st_templates = Path(env_st_templates)
|
||||
if st_templates.is_file():
|
||||
list_st_files.append(st_templates)
|
||||
|
||||
return [pytest.param(e, id=e.name) for e in list_st_files]
|
||||
|
||||
@pytest.fixture(scope="class", name="test_file_path", params=get_all_test_files())
|
||||
def test_data_path(request):
|
||||
return Path(request.param)
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def test_data(test_file_path):
|
||||
|
||||
2
tests/pytest.ini
Normal file
2
tests/pytest.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[pytest]
|
||||
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True
|
||||
Reference in New Issue
Block a user