'Test get availability zone from aggregate by given an instance.'

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))
