def test_update_host_availability_zone_cache(self):
        service = self._create_service_with_topic('compute', self.host)

        # Create a new aggregate with an AZ and add the host to the AZ
        az_name = 'az1'
        cache_key = az._make_cache_key(self.host)
        agg_az1 = self._create_az('agg-az1', az_name)
        self._add_to_aggregate(service, agg_az1)
        az.update_host_availability_zone_cache(self.context, self.host)
        self.assertEqual('az1', az._get_cache().get(cache_key))
        az.update_host_availability_zone_cache(self.context, self.host, 'az2')
        self.assertEqual('az2', az._get_cache().get(cache_key))
Test availability zone cache could be update.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/test_availability_zones.py/AvailabilityZoneTestCases.test_update_host_availability_zone_cache