'Ensure that we can walk multiple pages returned from listing GCE
volumes.'

def test_list_volumes_walks_pages(self):

    api = gceblockdeviceapi_for_test(self)
    api = api.set('_page_size', 1)
    volume_1 = api.create_volume(dataset_id=uuid4(), size=get_minimum_allocatable_size())
    volume_2 = api.create_volume(dataset_id=uuid4(), size=get_minimum_allocatable_size())
    blockdevice_ids = [v.blockdevice_id for v in api.list_volumes()]
    self.assertThat(blockdevice_ids, MatchesAll(Contains(volume_1.blockdevice_id), Contains(volume_2.blockdevice_id)))
    api.destroy_volume(volume_2.blockdevice_id)
    blockdevice_ids = [v.blockdevice_id for v in api.list_volumes()]
    self.assertThat(blockdevice_ids, MatchesAll(Contains(volume_1.blockdevice_id), Not(Contains(volume_2.blockdevice_id))))
