Commit 71a433f0 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Drop INVALID_SERIAL constant.

A serial is just like a tid.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2590 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e2294d5e
......@@ -107,7 +107,6 @@ cell_state_prefix_dict = {
INVALID_UUID = '\0' * 16
INVALID_TID = '\xff' * 8
INVALID_OID = '\xff' * 8
INVALID_SERIAL = INVALID_TID
INVALID_PARTITION = 0xffffffff
ZERO_TID = '\0' * 8
ZERO_OID = '\0' * 8
......
......@@ -24,7 +24,7 @@ from neo.tests import NeoUnitTestBase
from neo.client.app import Application, RevisionIndex
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageDoesNotExistError
from neo.protocol import Packet, Packets, Errors, INVALID_TID, INVALID_SERIAL
from neo.protocol import Packet, Packets, Errors, INVALID_TID
from neo.util import makeChecksum
import time
......@@ -320,7 +320,7 @@ class ClientApplicationTests(NeoUnitTestBase):
# now a cached version ewxists but should not be hit
mq.store((oid, tid2), ('WRONG', None))
self.assertTrue((oid, tid2) in mq)
another_object = (1, oid, tid2, INVALID_SERIAL, 0,
another_object = (1, oid, tid2, INVALID_TID, 0,
makeChecksum('RIGHT'), 'RIGHT', None)
packet = Packets.AnswerObject(*another_object[1:])
packet.setId(0)
......@@ -360,7 +360,7 @@ class ClientApplicationTests(NeoUnitTestBase):
self.assertRaises(NEOStorageDoesNotExistError, loadBefore, oid, tid2)
self.checkAskObject(conn)
# no visible version -> NEOStorageNotFoundError
an_object = (1, oid, INVALID_SERIAL, None, 0, 0, '', None)
an_object = (1, oid, INVALID_TID, None, 0, 0, '', None)
packet = Packets.AnswerObject(*an_object[1:])
packet.setId(0)
conn = Mock({
......
......@@ -23,7 +23,7 @@ from neo.storage.app import Application
from neo.storage.transactions import ConflictError, DelayedError
from neo.storage.handlers.client import ClientOperationHandler
from neo.protocol import INVALID_PARTITION
from neo.protocol import INVALID_TID, INVALID_OID, INVALID_SERIAL
from neo.protocol import INVALID_TID, INVALID_OID
from neo.protocol import Packets, LockState
class StorageClientHandlerTests(NeoUnitTestBase):
......@@ -93,7 +93,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
self.app.load_lock_dict[INVALID_OID] = object()
self.assertEquals(len(self.app.event_queue), 0)
self.operation.askObject(conn, oid=INVALID_OID,
serial=INVALID_SERIAL, tid=INVALID_TID)
serial=INVALID_TID, tid=INVALID_TID)
self.assertEquals(len(self.app.event_queue), 1)
self.checkNoPacketSent(conn)
self.assertEquals(len(self.app.dm.mockGetNamedCalls('getObject')), 0)
......@@ -104,7 +104,7 @@ class StorageClientHandlerTests(NeoUnitTestBase):
conn = self._getConnection()
self.assertEquals(len(self.app.event_queue), 0)
self.operation.askObject(conn, oid=INVALID_OID,
serial=INVALID_SERIAL, tid=INVALID_TID)
serial=INVALID_TID, tid=INVALID_TID)
calls = self.app.dm.mockGetNamedCalls('getObject')
self.assertEquals(len(self.app.event_queue), 0)
self.assertEquals(len(calls), 1)
......
......@@ -22,7 +22,7 @@ from neo.tests import NeoUnitTestBase
from neo.storage.app import Application
from neo.storage.handlers.storage import StorageOperationHandler
from neo.protocol import INVALID_PARTITION, Packets
from neo.protocol import INVALID_TID, INVALID_OID, INVALID_SERIAL
from neo.protocol import INVALID_TID, INVALID_OID
class StorageStorageHandlerTests(NeoUnitTestBase):
......
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