|
|
|
@ -585,7 +585,7 @@ class TestTemplateWrapper:
|
|
|
|
|
pytest.fail("Unexpected exception: {}".format(str(error)))
|
|
|
|
|
|
|
|
|
|
cfg_name = template_wrapper._get_cfg_path(template_wrapper.target_path)
|
|
|
|
|
assert cfg_name == join_paths(CHROOT_PATH, '/etc/dir_0/._cfg0001_file')
|
|
|
|
|
assert cfg_name == join_paths(CHROOT_PATH, '/etc/dir_0/._cfg0000_file')
|
|
|
|
|
|
|
|
|
|
def test_if_a_target_file_directory_contains_some_cfg_files_including_the_first_one__the_next_cfg_file_should_be_named_with_the_number_following_the_number_of_the_last_one(self):
|
|
|
|
|
parameters_object = ParametersContainer({'append': 'bind'})
|
|
|
|
@ -877,7 +877,7 @@ class TestTemplateWrapper:
|
|
|
|
|
'/etc/dir_0/file')
|
|
|
|
|
assert template_wrapper.output_path == join_paths(
|
|
|
|
|
CHROOT_PATH,
|
|
|
|
|
'/etc/dir_0/._cfg0001_file')
|
|
|
|
|
'/etc/dir_0/._cfg0000_file')
|
|
|
|
|
|
|
|
|
|
def test_if_after_the_target_file_check_contents_matching_flag_is_set_as_True_and_a_template_contains_source_parameter__the_output_and_the_input_paths_for_the_TemplateExecutor_is_the_same_and_it_is_target_path(self):
|
|
|
|
|
source = join_paths(CHROOT_PATH, '/etc/file')
|
|
|
|
@ -919,7 +919,7 @@ class TestTemplateWrapper:
|
|
|
|
|
assert template_wrapper.input_path == source
|
|
|
|
|
assert template_wrapper.output_path == join_paths(
|
|
|
|
|
CHROOT_PATH,
|
|
|
|
|
'/etc/dir_0/._cfg0001_file')
|
|
|
|
|
'/etc/dir_0/._cfg0000_file')
|
|
|
|
|
|
|
|
|
|
# Тестируем поведение, если формат исполняемый.
|
|
|
|
|
def test_if_a_target_path_is_FILE_and_a_template_is_executable__the_target_path_is_replaced_with_the_path_to_the_cwd_directory_and_there_is_no_package_type_conflicts_and_other_checks(self):
|
|
|
|
@ -1203,20 +1203,20 @@ class TestTemplateWrapper:
|
|
|
|
|
target_package
|
|
|
|
|
|
|
|
|
|
# Тестируем особенности поведения при различных значениях параметров.
|
|
|
|
|
def test_if_mirror_parameter_is_set_and_target_file_does_not_exist__a_TemplateWrapper_object_throws_TemplateExecutorError(self):
|
|
|
|
|
source = join_paths(CHROOT_PATH, '/etc/file')
|
|
|
|
|
parameters_object = ParametersContainer({'package': test_package_name,
|
|
|
|
|
'append': 'join',
|
|
|
|
|
'format': 'bind',
|
|
|
|
|
'source': source,
|
|
|
|
|
'mirror': True})
|
|
|
|
|
|
|
|
|
|
with pytest.raises(TemplateExecutorError):
|
|
|
|
|
TemplateWrapper(join_paths(CHROOT_PATH, '/etc/dir/none'),
|
|
|
|
|
parameters_object, FILE,
|
|
|
|
|
'/path/to/template',
|
|
|
|
|
chroot_path=CHROOT_PATH,
|
|
|
|
|
config_archive_path=CONFIG_ARCHIVE_PATH)
|
|
|
|
|
# def test_if_mirror_parameter_is_set_and_target_file_does_not_exist__a_TemplateWrapper_object_throws_TemplateExecutorError(self):
|
|
|
|
|
# source = join_paths(CHROOT_PATH, '/etc/file')
|
|
|
|
|
# parameters_object = ParametersContainer({'package': test_package_name,
|
|
|
|
|
# 'append': 'join',
|
|
|
|
|
# 'format': 'bind',
|
|
|
|
|
# 'source': source,
|
|
|
|
|
# 'mirror': True})
|
|
|
|
|
|
|
|
|
|
# with pytest.raises(TemplateExecutorError):
|
|
|
|
|
# TemplateWrapper(join_paths(CHROOT_PATH, '/etc/dir/none'),
|
|
|
|
|
# parameters_object, FILE,
|
|
|
|
|
# '/path/to/template',
|
|
|
|
|
# chroot_path=CHROOT_PATH,
|
|
|
|
|
# config_archive_path=CONFIG_ARCHIVE_PATH)
|
|
|
|
|
|
|
|
|
|
def test_if_mirror_parameter_is_set_and_file_from_the_source_parameter_does_not_exist__a_TemplateWrapper_object_sets_remove_original_flag_as_True(self):
|
|
|
|
|
parameters_object = ParametersContainer({'package': test_package_name,
|
|
|
|
|