Commit fbb71b46 authored by Julien Muchembled's avatar Julien Muchembled

client: fix regression that broke Storage.deleteObject (ExternalGC)

This fixes commit d90c5b83
("Allow NEO to store empty values").
parent 5c8f9e14
......@@ -151,8 +151,7 @@ class Storage(BaseStorage.BaseStorage,
@check_read_only
def deleteObject(self, oid, serial, transaction):
self.app.store(oid=oid, serial=serial, data='', version=None,
transaction=transaction)
self.app.store(oid, serial, None, None, transaction)
# mutliple revisions
def loadSerial(self, oid, serial):
......
......@@ -21,6 +21,7 @@ import transaction
import unittest
from thread import get_ident
from persistent import Persistent
from ZODB import POSException
from neo.storage.transactions import TransactionManager, \
DelayedError, ConflictError
from neo.lib.connection import MTClientConnection
......@@ -65,6 +66,31 @@ class Test(NEOThreadedTest):
finally:
cluster.stop()
def testDeleteObject(self):
cluster = NEOCluster()
try:
cluster.start()
storage = cluster.getZODBStorage()
for clear_cache in 0, 1:
for tst in 'a.', 'bcd.':
oid = storage.new_oid()
serial = None
for data in tst:
txn = transaction.Transaction()
storage.tpc_begin(txn)
if data == '.':
storage.deleteObject(oid, serial, txn)
else:
storage.store(oid, serial, data, '', txn)
storage.tpc_vote(txn)
serial = storage.tpc_finish(txn)
if clear_cache:
storage._cache.clear()
self.assertRaises(POSException.POSKeyError,
storage.load, oid, '')
finally:
cluster.stop()
def testStorageDataLock(self):
cluster = NEOCluster()
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment