Best Python code snippet using tempest_python
test_security_groups_negative.py
Source:test_security_groups_negative.py
...46 self.client.create_security_group_rule,47 group_create_body['security_group']['id'],48 protocol=pname)49 @attr(type=['negative', 'gate'])50 def test_create_security_group_rule_with_invalid_ports(self):51 group_create_body, _ = self._create_security_group()52 #Create rule with invalid ports53 states = [(-16, 80, 'Invalid value for port -16'),54 (80, 79, 'port_range_min must be <= port_range_max'),55 (80, 65536, 'Invalid value for port 65536'),56 (-16, 65536, 'Invalid value for port')]57 for pmin, pmax, msg in states:58 ex = self.assertRaises(exceptions.BadRequest,59 self.client.create_security_group_rule,60 group_create_body['security_group']['id'],61 protocol='tcp',62 port_range_min=pmin,63 port_range_max=pmax)64 self.assertIn(msg, str(ex))...
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!!