Best Python code snippet using tempest_python
test_servers_negative.py
Source:test_servers_negative.py  
...88        # Resize a server with null flavor89        self.assertRaises(exceptions.BadRequest, self.client.resize,90                          self.server_id, flavor_ref="")91    @attr(type=['negative', 'gate'])92    def test_reboot_non_existent_server(self):93        # Reboot a non existent server94        nonexistent_server = str(uuid.uuid4())95        self.assertRaises(exceptions.NotFound, self.client.reboot,96                          nonexistent_server, 'SOFT')97    @attr(type=['negative', 'gate'])98    def test_pause_paused_server(self):99        # Pause a paused server.100        self.client.pause_server(self.server_id)101        self.addCleanup(self.client.unpause_server,102                        self.server_id)103        self.client.wait_for_server_status(self.server_id, 'PAUSED')104        self.assertRaises(exceptions.Duplicate,105                          self.client.pause_server,106                          self.server_id)...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!!
