Best Python code snippet using tempest_python
test_roles_negative.py
Source:test_roles_negative.py
...64 self.roles_client.create_role, name=role_name)65 self.client.auth_provider.clear_auth()66 @test.attr(type=['negative'])67 @test.idempotent_id('c0cde2c8-81c1-4bb0-8fe2-cf615a3547a8')68 def test_role_create_duplicate(self):69 # Role names should be unique70 role_name = data_utils.rand_name(name='role-dup')71 body = self.roles_client.create_role(name=role_name)['role']72 role1_id = body.get('id')73 self.addCleanup(self.roles_client.delete_role, role1_id)74 self.assertRaises(lib_exc.Conflict, self.roles_client.create_role,75 name=role_name)76 @test.attr(type=['negative'])77 @test.idempotent_id('15347635-b5b1-4a87-a280-deb2bd6d865e')78 def test_delete_role_by_unauthorized_user(self):79 # Non-administrator user should not be able to delete role80 role_name = data_utils.rand_name(name='role')81 body = self.roles_client.create_role(name=role_name)['role']82 self.data.roles.append(body)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!