'Test volume can\'t be created from snapshot in a different az.'

def test_create_volume_from_snapshot_fail_wrong_az(self):

    volume_api = cinder.volume.api.API()
    def fake_list_availability_zones(enable_cache=False):
        return ({'name': 'nova', 'available': True}, {'name': 'az2', 'available': True})
    self.mock_object(volume_api, 'list_availability_zones', fake_list_availability_zones)
    volume_src = tests_utils.create_volume(self.context, availability_zone='az2', **self.volume_params)
    self.volume.create_volume(self.context, volume_src)
    snapshot = create_snapshot(volume_src['id'])
    self.volume.create_snapshot(self.context, snapshot)
    volume_dst = volume_api.create(self.context, size=1, name='fake_name', description='fake_desc', snapshot=snapshot)
    self.assertEqual('az2', volume_dst['availability_zone'])
    self.assertRaises(exception.InvalidInput, volume_api.create, self.context, size=1, name='fake_name', description='fake_desc', snapshot=snapshot, availability_zone='nova')
