'Test volume extend with a thick-provisioned volume'

@mock.patch('eventlet.greenthread.sleep')
def test_extend_volume(self, _mock_sleep):

    def get_copy_progress():
        for eta in range(5, (-1), (-1)):
            action_status = ('none' if (eta == 0) else 'remappingDve')
            complete = (action_status == 'none')
            (yield (complete, action_status, eta))
    fake_volume = copy.deepcopy(get_fake_volume())
    volume = copy.deepcopy(eseries_fake.VOLUME)
    new_capacity = 10
    volume['objectType'] = 'volume'
    self.library._client.expand_volume = mock.Mock()
    self.library._get_pool_operation_progress = mock.Mock(side_effect=get_copy_progress())
    self.library._get_volume = mock.Mock(return_value=volume)
    self.library.extend_volume(fake_volume, new_capacity)
    self.assertEqual(6, self.library._get_pool_operation_progress.call_count)
    self.library._client.expand_volume.assert_called_with(volume['id'], new_capacity, False)
