'Test checks snapshot\'s volume_size value after it is managed.'

@mock.patch('cinder.objects.snapshot.Snapshot.get_by_id')
def test_manage_snapshot_after_volume_extending(self, _get_by_id):

    fake_size = 3
    fake_snap = fake_snapshot.fake_snapshot_obj(self.ctxt, volume_size=fake_size)
    fake_snap.save = mock.MagicMock()
    _get_by_id.return_value = fake_snap
    real_size = 1
    mock_db = mock.MagicMock()
    mock_driver = mock.MagicMock()
    mock_manage_existing_ref = mock.MagicMock()
    mock_driver.manage_existing_snapshot.return_value = {}
    task = manager.ManageExistingTask(mock_db, mock_driver)
    result = task.execute(self.ctxt, fake_snap, mock_manage_existing_ref, real_size)
    snap_after_manage = result['snapshot']
    self.assertEqual(real_size, snap_after_manage['volume_size'])
