Example #1
0
 def test_create_and_check_template_list(self):
     params = {
         'file_name': YamlTemplateData.file_yaml.value.name,
         'data': YamlTemplateData.file_yaml.value.data,
     }
     upload_template(file_name=params['file_name'], file=params['data'])
     short_name = extract_name(params['file_name'])
     response = get_templates_list()
     assert short_name.encode() in response.content
Example #2
0
 def test_create_install_and_delete_template_without_data(self):
     params = {
         'file_name': YamlTemplateData.file_right_short.value.name,
         'data': YamlTemplateData.file_right_short.value.data,
     }
     upload_template(file_name=params['file_name'], file=params['data'])
     short_name = extract_name(params['file_name'])
     install_template(short_name)
     delete_template(short_name)
     response = get_templates_list()
     assert short_name.encode() not in response.content
Example #3
0
 def test_success_delete_template(self):
     params = {
         'file_name': YamlTemplateData.file_yaml.value.name,
         'data': YamlTemplateData.file_yaml.value.data,
     }
     upload_template(file_name=params['file_name'], file=params['data'])
     short_name = extract_name(params['file_name'])
     response = delete_template(short_name)
     assert response.status_code == 200
     assert ast.literal_eval(
         response.text
     )['message'] == f'Template with tmpl_id={short_name} successfully deleted!'
Example #4
0
 def test_create_install_and_delete_template_with_data(self):
     params = {
         'file_name': YamlTemplateData.file_right_short.value.name,
         'data': YamlTemplateData.file_right_short.value.data,
         'tmpl_id': str(random.randint(1, 10000000)),
     }
     upload_template(file_name=params['file_name'],
                     file=params['data'],
                     data={'tmpl_id': params['tmpl_id']})
     short_name = extract_name(params['file_name'])
     install_template(short_name)
     delete_template(short_name)
     response = get_templates_list()
     assert short_name.encode() not in response.content
Example #5
0
def set_template(name, data):
    upload_template(file_name=name, file=data)
    short_name = extract_name(name)
    install_template(short_name)
Example #6
0
 def test_success_install_template(self, file, data):
     upload_template(file_name=file, file=data)
     short_name = extract_name(file)
     response = install_template(short_name)
     assert response.status_code == 200