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
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
def test_delete_all_templates(self): params = { 'file_name_1': YamlTemplateData.file_yaml.value.name, 'data_1': YamlTemplateData.file_yaml.value.data, 'file_name_2': YamlTemplateData.file_right_short.value.name, 'data_2': YamlTemplateData.file_right_short.value.data, } upload_template(file_name=params['file_name_1'], file=params['data_1']) upload_template(file_name=params['file_name_2'], file=params['data_2']) delete_all_templates() response = get_templates_list() assert not extract_templates_list(response.content)
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
def delete_all_templates(): templates = extract_templates_list(get_templates_list().content) for template in templates: delete_template(template)
def test_success_get_list(self): response = get_templates_list() assert response.status_code == 200 assert response.content