Best Python code snippet using tempest_python
test_aggregates.py
Source:test_aggregates.py  
...171        self.assertEqual(aggregate_name, body['name'])172        self.assertIsNone(body['availability_zone'])173        self.assertIn(self.host, body['hosts'])174    @test.idempotent_id('96be03c7-570d-409c-90f8-e4db3c646996')175    def test_aggregate_add_host_create_server_with_az(self):176        # Add a host to the given aggregate and create a server.177        self.useFixture(fixtures.LockFixture('availability_zone'))178        aggregate_name = data_utils.rand_name(self.aggregate_name_prefix)179        az_name = data_utils.rand_name(self.az_name_prefix)180        aggregate = self.client.create_aggregate(181            name=aggregate_name, availability_zone=az_name)['aggregate']182        self.addCleanup(self.client.delete_aggregate, aggregate['id'])183        self.client.add_host(aggregate['id'], host=self.host)184        self.addCleanup(self.client.remove_host, aggregate['id'],185                        host=self.host)186        server_name = data_utils.rand_name('test_server')187        admin_servers_client = self.os_adm.servers_client188        server = self.create_test_server(name=server_name,189                                         availability_zone=az_name,...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!!
