How to use test_delete_role method in tempest

Best Python code snippet using tempest_python

test_roles.py

Source:test_roles.py Github

copy

Full Screen

...22 #assert res.status_code == 20023 assert res.json() == {"message":"Add permission to role"}24 res = requests.post('http://localhost:5000/role/del_perm', json={'role': 'my_user', 'permission': 'readonly'})25 assert res.status_code == 20026 def test_delete_role(self):27 res = requests.delete(self.main_url, json={'name': 'my_user'})28 assert res.status_code == 20029class Permissions:30 main_url = 'http://localhost:5000/perm'31 def test_create_perm(self):32 res = requests.post(self.main_url, json={'name': 'readonly'})33 assert res.status_code == 20134 def test_change_role(self):35 res = requests.put(self.main_url, json={'old_name': 'readonly', 'new_name': 'read_only'})36 assert res.status_code == 20037 def test_get_roles(self):38 res = requests.get(self.main_url)39 assert len(res.json()) == 140 assert res.json()[0]['name'] == 'read_only'41 assert res.status_code == 20042 def test_delete_role(self):43 res = requests.delete(self.main_url, json={'name': 'read_only'})...

Full Screen

Full Screen

test_role_preserve.py

Source:test_role_preserve.py Github

copy

Full Screen

...30 def test_edit_role(self):31 self.mcpage.click_MC()32 # self.mcpage.click_menu("角色维护")33 self.mcpage.edit_role("角色名称001", "新角色名称", "新角色描述")34 def test_delete_role(self):35 self.mcpage.click_MC()36 # self.mcpage.click_menu("角色维护")37 self.mcpage.delete_role("新角色名称")38# if __name__ == "__main__":39# test = TestRoleProserve()40# test.setup_class()41# test.test_delete_role()...

Full Screen

Full Screen

role.py

Source:role.py Github

copy

Full Screen

...13 14 def test_create_role(self):15 self.assertEqual("foo".upper(), "FOO")16 17 def test_delete_role(self):...

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