You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-utils-4-lib/tests/templates/test_directory_processor.py

53 lines
1.7 KiB

import pytest
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'})
cl_template = Variables({
'path':
'tests/templates/testfiles/test_dir_1,tests/templates/testfiles/test_dir_2'
})
cl_chroot = Variables({'path': '/etc'})
main = Variables({'cl_template': cl_template,
'cl_chroot': cl_chroot})
datavars = Variables({'install': install,
'merge': merge,
'variables': variables,
'main': main,
'custom': Variables()})
@pytest.mark.directory_processor
class TestDirectoryProcessor:
def test_just_for_debug(self):
try:
dir_processor = DirectoryProcessor('install', datavars_module=datavars,
package='package_1')
dir_processor.process_template_directories()
except Exception as error:
pytest.fail('Unexpected exception: {}'.format(str(error)))