|
|
|
@ -28,6 +28,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameter_value,
|
|
|
|
|
DIR, 1)
|
|
|
|
|
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert (parameters_object.append == 'join' and
|
|
|
|
|
parameters_object.chmod == 0o600 and
|
|
|
|
|
parameters_object.force and
|
|
|
|
@ -43,6 +44,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_object.append == 'join'
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -59,6 +61,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_object.source == join_paths(
|
|
|
|
|
CHROOT_PATH,
|
|
|
|
|
'/test_dir_1/file.test')
|
|
|
|
@ -68,7 +71,6 @@ class TestTemplateParameters:
|
|
|
|
|
finally:
|
|
|
|
|
parameters_processor.chroot_path = '/'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_as_dir_parameters_object_using_correct_source_parameter_with_append_link__the_object_will_be_initialized_successfully(self):
|
|
|
|
|
parameters = {'append': 'link', 'source': '/test_dir_1'}
|
|
|
|
|
|
|
|
|
@ -81,6 +83,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameter_value,
|
|
|
|
|
DIR, 1)
|
|
|
|
|
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.source == join_paths(CHROOT_PATH,
|
|
|
|
|
'/test_dir_1')
|
|
|
|
|
except Exception as error:
|
|
|
|
@ -99,6 +102,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
DIR, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_as_dir_parameters_object_using_source_parameter_but_without_append_link__the_initialization_of_the_object_will_be_failed(self):
|
|
|
|
|
parameters = {'source': '/test_dir_1/file.test'}
|
|
|
|
@ -111,6 +115,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
DIR, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_using_dictionary_with_correct_force_parameter__the_object_will_be_initialized_successfully(self):
|
|
|
|
|
parameters = {'force': True}
|
|
|
|
@ -123,6 +128,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
DIR, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.force
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -138,6 +144,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_using_dictionary_with_autoupdate_parameter__a_value_of_the_parameter_will_be_checked(self):
|
|
|
|
|
parameters = {'autoupdate': True}
|
|
|
|
@ -149,6 +156,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.autoupdate
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -164,6 +172,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_using_dictionary_with_correct_chown_parameter__the_object_will_be_initialized_successfully(self):
|
|
|
|
|
parameters = {'chown': 'root:root'}
|
|
|
|
@ -175,6 +184,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.chown == {'uid': 0, 'gid': 0}
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -192,6 +202,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.chown == {'uid': uid, 'gid': gid}
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -207,6 +218,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
|
|
|
|
|
def test_if_TemplateParameters_object_is_intialized_using_dictionary_with_correct_chmod_parameter__the_object_will_be_initialized_successfully(self):
|
|
|
|
|
parameters = {'chmod': 'rw-r--r--'}
|
|
|
|
@ -218,6 +230,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.chmod == 0o644
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
@ -233,6 +246,7 @@ class TestTemplateParameters:
|
|
|
|
|
parameters_processor.check_template_parameter(parameter_name,
|
|
|
|
|
parameter_value,
|
|
|
|
|
FILE, 1)
|
|
|
|
|
parameters_processor.check_postparse_parameters()
|
|
|
|
|
assert parameters_processor.chmod == 0o600
|
|
|
|
|
except Exception as error:
|
|
|
|
|
pytest.fail('Unexpected exception: {0}'.
|
|
|
|
|