|
|
|
@ -3042,6 +3042,27 @@ AttributeError: module 'os' has no attribute 'suspicious_attribute'
|
|
|
|
|
out_text = out_file.read()
|
|
|
|
|
assert out_text == expected_output
|
|
|
|
|
|
|
|
|
|
def test_error_while_using_not_text_file_as_input_file_for_append_join(self):
|
|
|
|
|
target_path = join_paths(CHROOT_PATH,
|
|
|
|
|
'/etc/append_join_file_testfiles/file_19')
|
|
|
|
|
source_path = join_paths(CHROOT_PATH,
|
|
|
|
|
'/etc/append_join_file_testfiles/logo.png')
|
|
|
|
|
|
|
|
|
|
parameters_object = ParametersContainer({'package': test_package_name,
|
|
|
|
|
'append': 'join',
|
|
|
|
|
'source': source_path,
|
|
|
|
|
'format': 'raw'})
|
|
|
|
|
|
|
|
|
|
template_wrapper = TemplateWrapper(
|
|
|
|
|
target_path,
|
|
|
|
|
parameters_object, FILE,
|
|
|
|
|
'/path/to/template',
|
|
|
|
|
template_text='',
|
|
|
|
|
chroot_path=CHROOT_PATH,
|
|
|
|
|
config_archive_path=CONFIG_ARCHIVE_PATH)
|
|
|
|
|
with pytest.raises(TemplateExecutorError):
|
|
|
|
|
template_executor._append_join_file(template_wrapper)
|
|
|
|
|
|
|
|
|
|
def test_to_remove_changed_testfiles(self):
|
|
|
|
|
shutil.rmtree(os.path.join(CHROOT_PATH, 'etc'))
|
|
|
|
|
shutil.rmtree(os.path.join(CHROOT_PATH, 'unprotected'))
|
|
|
|
|