def test_describe_availability_zones_verbose(self):
     self.nova.availability_zones.list.return_value = [
         fakes.NovaAvailabilityZone(fakes.OS_AVAILABILITY_ZONE),
         fakes.NovaAvailabilityZone(fakes.OS_AVAILABILITY_ZONE_INTERNAL)]
     resp = self.execute('DescribeAvailabilityZones',
                         {'zoneName.1': 'verbose'})
     self.assertEqual(len(resp['availabilityZoneInfo']), 7)
     self.nova.availability_zones.list.assert_called_once_with()
    def test_describe_availability_zones(self):
        self.nova.availability_zones.list.return_value = [
            fakes.NovaAvailabilityZone(fakes.OS_AVAILABILITY_ZONE),
            fakes.NovaAvailabilityZone(fakes.OS_AVAILABILITY_ZONE_INTERNAL)]
        resp = self.execute('DescribeAvailabilityZones', {})
        self.assertThat(resp['availabilityZoneInfo'],
                        matchers.ListMatches([fakes.EC2_AVAILABILITY_ZONE]))
        self.nova.availability_zones.list.assert_called_once_with(
            detailed=False)

        self.check_filtering(
            'DescribeAvailabilityZones', 'availabilityZoneInfo',
            [('state', 'available'),
             ('zone-name', fakes.NAME_AVAILABILITY_ZONE)])