How to use test_delete_group method in tempest

Best Python code snippet using tempest_python

test_create_group.py

Source:test_create_group.py Github

copy

Full Screen

1import requests2import unittest3import json4from lib.case_log import *5import os6import sys7sys.path.append("../../..")8from config.config import *9from lib.read_excel import *10from lib.case_log import log_case_info11class TestCreateGroup(unittest.TestCase):12 @classmethod13 def setUpClass(cls): # 整个测试类只执行一次14 cls.data_list = excel_to_list(os.path.join(data_path, "test_dop_data.xlsx"), "TestCreateGroup") # 读取该测试类所有用例数据15 def test_create_Group_ture(self):16 case_data = get_test_data(self.data_list,"test_create_Group_ture") # 从数据列表中查找到该用例数据17 if not case_data: # 有可能为None18 logging.error("用例数据不存在")19 url = case_data.get('url') # excel中的标题也必须是小写url20 data = case_data.get('data') #需要用json.loads()转化为字典格式21 expect_res = case_data.get('expect_res')22 res = requests.post(url=url,json=json.loads(data),headers=headers)23 log_case_info('test_create_Group_ture', url, data, expect_res, res.text)24 self.assertEqual(expect_res, res.text)25 def test_create_Group_duplication(self):26 case_data = get_test_data(self.data_list,"test_create_Group_duplication")27 if not case_data:28 logging.error("用例数据不存在")29 url = case_data.get('url')30 data =case_data.get('data')31 expect_res = case_data.get('expect_res')32 res = requests.post(url=url, json=json.loads(data), headers=headers)33 log_case_info('test_create_Group_duplication', url, data, expect_res, res.text)34 self.assertEqual(expect_res, res.text)35 def test_delete_Group(self):36 case_data = get_test_data(self.data_list,"test_delete_Group")37 if not case_data:38 logging.error("用例数据不存在")39 40if __name__ == '__main__':...

Full Screen

Full Screen

test_del_group.py

Source:test_del_group.py Github

copy

Full Screen

...13# #удаление 1 элемента списка14# old_groups[index:index+1] = []15# assert old_groups == new_groups16#17# def test_delete_group(app, db, check_ui):18# if len(db.get_group_list()) == 0:19# app.group.create(Group(name="test", header="header", footer="footer"))20# old_groups = db.get_group_list()21# group = random.choice(old_groups)22# app.group.delete_group_by_id(group.id)23# new_groups = db.get_group_list()24# assert len(old_groups) - 1 == len(new_groups)25# #удаление 1 элемента списка26# old_groups.remove(group)27# assert old_groups == new_groups28# if check_ui:29# assert sorted(new_groups, key=Group.id_or_max) == sorted(app.group.get_group_list(), key=Group.id_or_max)30def test_delete_group(app, db, check_ui):31 if len(db.get_group_list()) == 0:32 app.group.create(Group(name="test", header="header", footer="footer"))33 old_groups = db.get_group_list()34 group = random.choice(old_groups)35 app.group.delete_group_by_id(group.id)36 new_groups = db.get_group_list()37 assert len(old_groups) - 1 == len(new_groups)38 #удаление 1 элемента списка39 old_groups.remove(group)40 assert old_groups == new_groups41 if check_ui:...

Full Screen

Full Screen

group_scenarios.py

Source:group_scenarios.py Github

copy

Full Screen

...3@scenario('groups.feature', 'Add new group')4def test_add_new_group():5 pass6@scenario('groups.feature', 'Delete a group')7def test_delete_group():...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful