import pytest import time import os from calculate.templates.template_processor import DirectoryProcessor from calculate.templates.template_engine import Variables # Вместо модуля переменных. group = Variables({'bool': True, 'list': [1, 2, 3]}) variables = Variables({'variable_1': 'value_1', 'variable_2': 'value_2', 'group': group}) install = Variables({'os_disk_dev': 'os_disk_dev_value', 'version': 1.5, 'number': 128, 'boolean': False, 'type': 'static', 'path': '/usr/sbin'}) merge = Variables({'var_1': 674, 'var_2': 48, 'version': 1.0, 'calculate_domains': 'lists.calculate-linux.org', 'ip_value': '127.0.0.0/8'}) main = Variables({'cl_template_path': ('tests/templates/testfiles/template_dir_1,' 'tests/templates/testfiles/template_dir_2'), 'cl_chroot_path': '/'}) test = Variables({'test_root': os.path.join(os.getcwd(), 'tests/templates/testfiles')}) datavars = Variables({'install': install, 'merge': merge, 'variables': variables, 'main': main, 'test': test, 'custom': Variables()}) @pytest.mark.directory_processor class TestDirectoryProcessor: def test_just_for_debug(self): start_time = time.time() try: dir_processor = DirectoryProcessor( 'install', datavars_module=datavars, package='xfce-extra/xfce4-screenshooter', test_mode=True) dir_processor.process_template_directories() except Exception as error: pytest.fail('Unexpected exception: {}'.format(str(error))) # print('time: {}'.format(time.time() - start_time)) # assert False