Best Python code snippet using tempest_python
test_security_groups.py
Source:test_security_groups.py
...114 self.client.delete_security_group(sg['id'])115 self.client.delete_security_group(sg2['id'])116 @test.idempotent_id('7d4e1d3c-3209-4d6d-b020-986304ebad1f')117 @test.services('network')118 def test_update_security_groups(self):119 # Update security group name and description120 # Create a security group121 securitygroup = self.create_security_group()122 self.assertIn('id', securitygroup)123 securitygroup_id = securitygroup['id']124 # Update the name and description125 s_new_name = data_utils.rand_name('sg-hth')126 s_new_des = data_utils.rand_name('description-hth')127 self.client.update_security_group(securitygroup_id,128 name=s_new_name,129 description=s_new_des)130 # get the security group131 fetched_group = (self.client.show_security_group(securitygroup_id)132 ['security_group'])...
test_security_groups_rbac.py
Source:test_security_groups_rbac.py
...46 @rbac_rule_validation.action(47 service="nova",48 rule="os_compute_api:os-security-groups")49 @decorators.idempotent_id('3de5c6bc-b822-469e-a627-82427d38b067')50 def test_update_security_groups(self):51 sec_group_id = self.create_security_group()['id']52 self.rbac_utils.switch_role(self, toggle_rbac_role=True)53 new_name = data_utils.rand_name()54 new_desc = data_utils.rand_name()55 self.security_groups_client.update_security_group(sec_group_id,56 name=new_name,57 description=new_desc)58 @rbac_rule_validation.action(59 service="nova",60 rule="os_compute_api:os-security-groups")61 @decorators.idempotent_id('6edc0320-302d-11e7-93ae-92361f002671')62 def test_show_security_groups(self):63 sec_group_id = self.create_security_group()['id']64 self.rbac_utils.switch_role(self, toggle_rbac_role=True)...
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!!