|
|
|
@ -1632,6 +1632,32 @@ os.linux.test_3 = {{ os.linux.test_3 }}
|
|
|
|
|
assert datavars_1.os.linux.test == 'new_first'
|
|
|
|
|
assert datavars_2.os.linux.test == 'new_second'
|
|
|
|
|
|
|
|
|
|
def test_adding_some_custom_variables(self):
|
|
|
|
|
datavars = Datavars(
|
|
|
|
|
variables_path=os.path.join(TESTFILES_PATH, 'variables_7'))
|
|
|
|
|
template_engine = TemplateEngine(appends_set=APPENDS_SET,
|
|
|
|
|
chroot_path=TESTFILES_PATH,
|
|
|
|
|
datavars_module=datavars)
|
|
|
|
|
|
|
|
|
|
input_template_1 = '''{% calculate run='/bin/bash' -%}
|
|
|
|
|
{% save custom.qwerty = 'www-firefox,www-chromium' -%}
|
|
|
|
|
{% save custom.zxcv2.qwerty = 'www-firefox,www-chromium2' -%}
|
|
|
|
|
{% save custom.zxcv2.qwerty2 = 'www-firefox,www-chromium' -%}
|
|
|
|
|
echo {{ custom.qwerty }}
|
|
|
|
|
echo {{ custom.zxcv2.qwerty }}
|
|
|
|
|
echo {{ custom.zxcv2.qwerty2 }}
|
|
|
|
|
exit 0
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
expected_output = '''echo www-firefox,www-chromium
|
|
|
|
|
echo www-firefox,www-chromium2
|
|
|
|
|
echo www-firefox,www-chromium
|
|
|
|
|
exit 0'''
|
|
|
|
|
|
|
|
|
|
template_engine.process_template_from_string(input_template_1, FILE)
|
|
|
|
|
result = template_engine.template_text
|
|
|
|
|
assert result == expected_output
|
|
|
|
|
|
|
|
|
|
def test_for_removing_testfiles(self):
|
|
|
|
|
shutil.rmtree(os.path.join(TESTFILES_PATH, 'gentoo'))
|
|
|
|
|
assert not os.path.exists(os.path.join(TESTFILES_PATH, 'gentoo'))
|
|
|
|
|