def test_get_instance_availability_zone_from_aggregate(self):
        host = 'host170'
        service = self._create_service_with_topic('compute', host)
        self._add_to_aggregate(service, self.agg)

        fake_inst = objects.Instance(host=host,
                                     availability_zone=self.availability_zone)

        self.assertEqual(self.availability_zone,
                az.get_instance_availability_zone(self.context, fake_inst))
Test get availability zone from aggregate by given an instance.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/test_availability_zones.py/AvailabilityZoneTestCases.test_get_instance_availability_zone_from_aggregate