'Test extend volume.'

@mock.patch.object(qnap.QnapISCSIDriver, '_extend_lun')
@mock.patch('cinder.volume.drivers.qnap.QnapAPIExecutor')
def test_extend_volume(self, mock_api_executor, mock_extend_lun):

    fake_volume = VolumeClass('fakeDisplayName', 'fakeId', 100, 'fakeLunName')
    mock_api_executor.return_value.get_basic_info.return_value = ('ES1640dc    ', 'ES1640dc    ', '1.1.3')
    self.driver = qnap.QnapISCSIDriver(configuration=create_configuration('admin', 'qnapadmin', 'http://1.2.3.4:8080', '1.2.3.4', 'Pool1', True))
    self.driver.do_setup('context')
    self.driver.extend_volume(fake_volume, 'fakeSize')
    mock_extend_lun.assert_called_once_with(fake_volume, '')
